Commit 2efb3a59 authored by Tres Seaver's avatar Tres Seaver

Don't assume Warning is an old-style class (i.e., in Python 2.5).

parent acd96fbd
......@@ -35,7 +35,7 @@ def warn_category(category):
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment