Commit d292efbb authored by Stefan Behnel's avatar Stefan Behnel

fix shadow module in Py3

parent 3b9a6dc5
......@@ -347,11 +347,6 @@ except NameError: # Py3
py_float = typedef(float, "float")
py_complex = typedef(complex, "double complex")
try:
unicode = typedef(unicode, "unicode")
except NameError: # Py3
unicode = typedef(str, "unicode")
# Predefined types
......@@ -370,6 +365,15 @@ to_repr = {
gs = globals()
# note: cannot simply name the unicode type here as 2to3 gets in the way and replaces it by str
try:
import __builtin__ as builtins
except ImportError: # Py3
import builtins
gs['unicode'] = typedef(getattr(builtins, 'unicode', str), 'unicode')
del builtins
for name in int_types:
reprname = to_repr(name, name)
gs[name] = typedef(py_int, reprname)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment