[Python-checkins] r70603 - python/branches/py3k/Lib/weakref.py

brett.cannon python-checkins at python.org
Thu Mar 26 00:31:22 CET 2009


Author: brett.cannon
Date: Thu Mar 26 00:31:22 2009
New Revision: 70603

Log:
Fix a circular import dependency.


Modified:
   python/branches/py3k/Lib/weakref.py

Modified: python/branches/py3k/Lib/weakref.py
==============================================================================
--- python/branches/py3k/Lib/weakref.py	(original)
+++ python/branches/py3k/Lib/weakref.py	Thu Mar 26 00:31:22 2009
@@ -9,8 +9,6 @@
 # they are called this instead of "ref" to avoid name collisions with
 # the module-global ref() function imported from _weakref.
 
-import collections
-
 from _weakref import (
      getweakrefcount,
      getweakrefs,
@@ -22,6 +20,8 @@
 
 from _weakrefset import WeakSet
 
+import collections  # Import after _weakref to avoid circular import.
+
 ProxyTypes = (ProxyType, CallableProxyType)
 
 __all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",


More information about the Python-checkins mailing list