[Zope3-checkins] SVN: Zope3/branches/3.3/src/zope/interface/declarations.py Use types.ModuleType to check type of module.

Baiju M baiju.m.mail at gmail.com
Tue Sep 12 00:51:17 EDT 2006


Log message for revision 70112:
  Use types.ModuleType to check type of module.
  

Changed:
  U   Zope3/branches/3.3/src/zope/interface/declarations.py

-=-
Modified: Zope3/branches/3.3/src/zope/interface/declarations.py
===================================================================
--- Zope3/branches/3.3/src/zope/interface/declarations.py	2006-09-12 02:35:57 UTC (rev 70111)
+++ Zope3/branches/3.3/src/zope/interface/declarations.py	2006-09-12 04:51:16 UTC (rev 70112)
@@ -34,7 +34,7 @@
 from zope.interface.interface import InterfaceClass, Specification
 from ro import mergeOrderings, ro
 import exceptions
-from types import ClassType
+from types import ClassType, ModuleType
 from zope.interface.advice import addClassAdvisor
 
 # Registry of class-implementation specifications
@@ -1170,9 +1170,7 @@
         raise TypeError(
             "moduleProvides can only be used once in a module definition.")
 
-    module = sys.modules[__name__]
-
-    locals["__provides__"] = Provides(type(module),
+    locals["__provides__"] = Provides(ModuleType,
                                       *_normalizeargs(interfaces))
 
 ##############################################################################



More information about the Zope3-Checkins mailing list