Open serac opened 8 years ago
The problem seems to be that str has been replaced:
from future.builtins import chr, dict, int, str
Therefore in Python 2 a literal string won't be of type str:
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'foo'
>>> isinstance(a, str)
True
>>> from future.builtins import str
>>> isinstance(a, str)
False
>>> b = 'bar'
>>> isinstance(b, str)
False
Maybe the code will need to check if it is PY2 and then test for an instance of basestring.
Interactive session demonstrating problem:
The error is caused by the following
isinstance
check:I have verified that replacing
str
withbasestring
fixes the problem, but I am totally at a loss as to why.