axiak / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
295 stars 39 forks source link

Fixed basestring NameError in Python3 #37

Closed ulikoehler closed 8 years ago

ulikoehler commented 8 years ago

When installing pyre2 using pip3 and subsequently importing it, I get the following error message:

Traceback (most recent call last):
  File "./katc.py", line 3, in <module>
    from check import performRender
  File "/home/uli/dev/KATranslationCheck/check.py", line 28, in <module>
    from Rules import Severity, importRulesForLanguage
  File "/home/uli/dev/KATranslationCheck/Rules.py", line 4, in <module>
    import re2 as re
  File "re2.pyx", line 1, in init re2 (src/re2.cpp:13681)

This pull request fixes that by defining basestring globally in the pyx file if it is not defined (i.e. in python3)

ulikoehler commented 8 years ago

Hm, I think https://github.com/axiak/pyre2/pull/33 also fixes this, so I'll close my PR