Fix running the copy module from the command-line (however use{ful,less} it may be).
This commit is contained in:
parent
b5cfd555b2
commit
d6399d2d19
|
@ -51,6 +51,7 @@ __getstate__() and __setstate__(). See the documentation for module
|
||||||
import types
|
import types
|
||||||
import weakref
|
import weakref
|
||||||
from copyreg import dispatch_table
|
from copyreg import dispatch_table
|
||||||
|
import builtins
|
||||||
|
|
||||||
class Error(Exception):
|
class Error(Exception):
|
||||||
pass
|
pass
|
||||||
|
@ -109,7 +110,7 @@ t = getattr(types, "CodeType", None)
|
||||||
if t is not None:
|
if t is not None:
|
||||||
d[t] = _copy_immutable
|
d[t] = _copy_immutable
|
||||||
for name in ("complex", "unicode"):
|
for name in ("complex", "unicode"):
|
||||||
t = globals()['__builtins__'].get(name)
|
t = getattr(builtins, name, None)
|
||||||
if t is not None:
|
if t is not None:
|
||||||
d[t] = _copy_immutable
|
d[t] = _copy_immutable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue