From b268114a0da1dc306cdcb9359ffa5a09bd99089f Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 17 Oct 2019 17:48:53 -0700 Subject: Py3 cleanup: Remove workaround from Python3 unichr() (#144) On Python3, always use chr(). --- examples/booleansearchparser.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'examples/booleansearchparser.py') diff --git a/examples/booleansearchparser.py b/examples/booleansearchparser.py index e0ac39b..48456a2 100644 --- a/examples/booleansearchparser.py +++ b/examples/booleansearchparser.py @@ -87,11 +87,6 @@ from __future__ import print_function from pyparsing import Word, alphanums, Keyword, Group, Forward, Suppress, OneOrMore, oneOf import re -# Py2 compatibility -try: - _unichr = unichr -except NameError: - _unichr = chr alphabet_ranges = [ ##CYRILIC: https://en.wikipedia.org/wiki/Cyrillic_(Unicode_block) @@ -151,7 +146,7 @@ class BooleanSearchParser: #suport for non-western alphabets for r in alphabet_ranges: - alphabet += u''.join(_unichr(c) for c in range(*r) if not _unichr(c).isspace()) + alphabet += u''.join(chr(c) for c in range(*r) if not chr(c).isspace()) operatorWord = Group( Word(alphabet + '*') -- cgit v1.2.1