[Checkins] SVN: zope.component/tseaver-test_cleanup/ Remove ancient BBB cruft.

Tres Seaver cvs-admin at zope.org
Fri Jun 22 19:26:14 UTC 2012


Log message for revision 127045:
  Remove ancient BBB cruft.

Changed:
  _U  zope.component/tseaver-test_cleanup/
  U   zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py

-=-
Modified: zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py
===================================================================
--- zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py	2012-06-22 19:26:06 UTC (rev 127044)
+++ zope.component/tseaver-test_cleanup/src/zope/component/_declaration.py	2012-06-22 19:26:11 UTC (rev 127045)
@@ -33,11 +33,8 @@
     frame = sys._getframe(1)
     locals = frame.f_locals
 
-    # Try to make sure we were called from a class def. In 2.2.0 we can't
-    # check for __module__ since it doesn't seem to be added to the locals
-    # until later on.
-    if (locals is frame.f_globals) or (
-        ('__module__' not in locals) and sys.version_info[:3] > (2, 2, 0)):
+    # Ensure we were called from a class def.
+    if locals is frame.f_globals or '__module__' not in locals:
         raise TypeError("adapts can be used only from a class definition.")
 
     if '__component_adapts__' in locals:



More information about the checkins mailing list