You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
micah@micah-computer:~/prj2/v8eval/python/test$ python3 -m test_v8eval.py
/usr/bin/python3: Error while finding spec for 'test_v8eval.py' (<class 'AttributeError'>: 'module' object has no attribute '__path__')
micah@micah-computer:~/prj2/v8eval/python/test$ python3 -m unittest test_v8eval.py
E.EException in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/home/micah/prj2/v8eval/python/test/test_v8eval.py", line 15, in run
self.v8.eval('function inc(x) { return x + 1; }')
File "/usr/local/lib/python3.4/dist-packages/v8eval.py", line 156, in eval
if not isinstance(src, basestring):
NameError: name 'basestring' is not defined
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/home/micah/prj2/v8eval/python/test/test_v8eval.py", line 15, in run
self.v8.eval('function inc(x) { return x + 1; }')
File "/usr/local/lib/python3.4/dist-packages/v8eval.py", line 156, in eval
if not isinstance(src, basestring):
NameError: name 'basestring' is not defined
.
======================================================================
ERROR: test_call (test_v8eval.V8TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/micah/prj2/v8eval/python/test/test_v8eval.py", line 38, in test_call
v8.eval('function inc(x) { return x + 1; }')
File "/usr/local/lib/python3.4/dist-packages/v8eval.py", line 156, in eval
if not isinstance(src, basestring):
NameError: name 'basestring' is not defined
======================================================================
ERROR: test_eval (test_v8eval.V8TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/micah/prj2/v8eval/python/test/test_v8eval.py", line 24, in test_eval
self.assertEqual(v8.eval('1 + 2'), 3)
File "/usr/local/lib/python3.4/dist-packages/v8eval.py", line 156, in eval
if not isinstance(src, basestring):
NameError: name 'basestring' is not defined
----------------------------------------------------------------------
Ran 4 tests in 0.659s
FAILED (errors=2)
Python six addresses this by basically doing this:
Anywhere you use basestring you may replace it with string_types.
Note: Python 3.x strings can contain Unicode characters, and Python 2.x basestring only contain bytes (with unicode characters being multiple escaped bytes). This may or many not be a problem for v8, but you should be well aware that Python 2 and 3 are very different in this regard to string types.
This may not be the only compatibility issue regarding Python 3.x.
The text was updated successfully, but these errors were encountered:
basestring in the file _v8eval.py is not defined in Python 3.x.
Dump from IPython Console version 3.4.3
Output from
$ python3 -m unittest test_v8eval.py
:Python
six
addresses this by basically doing this:Anywhere you use
basestring
you may replace it withstring_types
.Note: Python 3.x strings can contain Unicode characters, and Python 2.x basestring only contain bytes (with unicode characters being multiple escaped bytes). This may or many not be a problem for v8, but you should be well aware that Python 2 and 3 are very different in this regard to string types.
This may not be the only compatibility issue regarding Python 3.x.
The text was updated successfully, but these errors were encountered: