summaryrefslogtreecommitdiffstats
path: root/Lib/copy.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-04 17:46:44 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-04 17:46:44 (GMT)
commitd6399d2d19ef665a2893089be12e2214f73b643b (patch)
tree36c5ffa3825db0cc1314b4491080462d8bff8252 /Lib/copy.py
parentb5cfd555b218ff6ac2053029a513d4f61df7cd21 (diff)
downloadcpython-d6399d2d19ef665a2893089be12e2214f73b643b.zip
cpython-d6399d2d19ef665a2893089be12e2214f73b643b.tar.gz
cpython-d6399d2d19ef665a2893089be12e2214f73b643b.tar.bz2
Fix running the copy module from the command-line (however use{ful,less} it may be).
Diffstat (limited to 'Lib/copy.py')
-rw-r--r--Lib/copy.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/copy.py b/Lib/copy.py
index 07f1d23..089d101 100644
--- a/Lib/copy.py
+++ b/Lib/copy.py
@@ -51,6 +51,7 @@ __getstate__() and __setstate__(). See the documentation for module
import types
import weakref
from copyreg import dispatch_table
+import builtins
class Error(Exception):
pass
@@ -109,7 +110,7 @@ t = getattr(types, "CodeType", None)
if t is not None:
d[t] = _copy_immutable
for name in ("complex", "unicode"):
- t = globals()['__builtins__'].get(name)
+ t = getattr(builtins, name, None)
if t is not None:
d[t] = _copy_immutable