diff options
author | Brett Cannon <bcannon@gmail.com> | 2006-06-22 16:49:14 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2006-06-22 16:49:14 +0000 |
commit | 53ab5b761d9e6e0f8b06c328508bafdb9a6a25ac (patch) | |
tree | 721af8f962a8991f6924e6834c31f2d3c3ba2756 /Lib/warnings.py | |
parent | 56b76c8a65aafc77cbeeb326450186de1898df7f (diff) | |
download | cpython-git-53ab5b761d9e6e0f8b06c328508bafdb9a6a25ac.tar.gz |
'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType. The latter is no
longer true thanks to new-style exceptions.
Closes bug #1510580. Thanks to AMK for the test.
Diffstat (limited to 'Lib/warnings.py')
-rw-r--r-- | Lib/warnings.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py index 4b4119dd94..939184f7ca 100644 --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -254,8 +254,7 @@ def _getcategory(category): cat = getattr(m, klass) except AttributeError: raise _OptionError("unknown warning category: %r" % (category,)) - if (not isinstance(cat, types.ClassType) or - not issubclass(cat, Warning)): + if not issubclass(cat, Warning): raise _OptionError("invalid warning category: %r" % (category,)) return cat |