Log message for revision 91879: - Accept new-style classes as valid warning categories. Patch by Ranjith Kannikara, GSoC student.
Changed: U Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py -=- Modified: Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py =================================================================== --- Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py 2008-10-07 18:32:12 UTC (rev 91878) +++ Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py 2008-10-07 19:25:16 UTC (rev 91879) @@ -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, types.ClassType)) or not issubclass(cat, Warning)): raise ValueError("invalid warning category: %s" % `category`) return cat _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins