]> granicus.if.org Git - python/commitdiff
Fix running the copy module from the command-line (however use{ful,less} it may be).
authorAntoine Pitrou <solipsis@pitrou.net>
Sat, 4 Sep 2010 17:46:44 +0000 (17:46 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sat, 4 Sep 2010 17:46:44 +0000 (17:46 +0000)
Lib/copy.py

index 07f1d23f295ec88dadb74973f8691119888df6a4..089d101c7ca3f0172fd9af0580af34148cf1358f 100644 (file)
@@ -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