diff options
author | shadchin <[email protected]> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/cython/Cython/Compiler/TreePath.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/TreePath.py')
-rw-r--r-- | contrib/tools/cython/Cython/Compiler/TreePath.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/TreePath.py b/contrib/tools/cython/Cython/Compiler/TreePath.py index 978f2f6c5c2..8585905557b 100644 --- a/contrib/tools/cython/Cython/Compiler/TreePath.py +++ b/contrib/tools/cython/Cython/Compiler/TreePath.py @@ -10,13 +10,13 @@ from __future__ import absolute_import import re import operator -import sys +import sys + +if sys.version_info[0] >= 3: + _unicode = str +else: + _unicode = unicode -if sys.version_info[0] >= 3: - _unicode = str -else: - _unicode = unicode - path_tokenizer = re.compile( r"(" r"'[^']*'|\"[^\"]*\"|" @@ -173,11 +173,11 @@ def handle_attribute(next, token): continue if attr_value == value: yield attr_value - elif (isinstance(attr_value, bytes) and isinstance(value, _unicode) and - attr_value == value.encode()): - # allow a bytes-to-string comparison too - yield attr_value - + elif (isinstance(attr_value, bytes) and isinstance(value, _unicode) and + attr_value == value.encode()): + # allow a bytes-to-string comparison too + yield attr_value + return select |