[Zope-Checkins] SVN: Zope/trunk/lib/python/Zope2/Startup/warnfilter.py Don't assume Warning is an old-style class (i.e., in Python 2.5).

Tres Seaver tseaver at palladion.com
Sun Aug 24 14:10:33 EDT 2008


Log message for revision 90177:
  Don't assume Warning is an old-style class (i.e., in Python 2.5).

Changed:
  U   Zope/trunk/lib/python/Zope2/Startup/warnfilter.py

-=-
Modified: Zope/trunk/lib/python/Zope2/Startup/warnfilter.py
===================================================================
--- Zope/trunk/lib/python/Zope2/Startup/warnfilter.py	2008-08-24 18:09:54 UTC (rev 90176)
+++ Zope/trunk/lib/python/Zope2/Startup/warnfilter.py	2008-08-24 18:10:32 UTC (rev 90177)
@@ -35,7 +35,7 @@
             cat = getattr(m, klass)
         except AttributeError:
             raise ValueError("unknown warning category: %s" % `category`)
-    if (not isinstance(cat, types.ClassType) or
+    if (not isinstance(cat, type(Warning)) or
         not issubclass(cat, Warning)):
         raise ValueError("invalid warning category: %s" % `category`)
     return cat



More information about the Zope-Checkins mailing list