diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-10-17 17:48:53 -0700 |
---|---|---|
committer | Paul McGuire <ptmcg@users.noreply.github.com> | 2019-10-17 19:48:53 -0500 |
commit | b268114a0da1dc306cdcb9359ffa5a09bd99089f (patch) | |
tree | a6b7136f03d42c87fce0a11cb46499e0b00f42ed /examples/booleansearchparser.py | |
parent | fd8252e8b762677dc3d47fc28dd68685fef61f6a (diff) | |
download | pyparsing-git-b268114a0da1dc306cdcb9359ffa5a09bd99089f.tar.gz |
Py3 cleanup: Remove workaround from Python3 unichr() (#144)
On Python3, always use chr().
Diffstat (limited to 'examples/booleansearchparser.py')
-rw-r--r-- | examples/booleansearchparser.py | 7 |
1 files changed, 1 insertions, 6 deletions
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 + '*') |