From: Georg Brandl Date: Sat, 18 Jul 2009 09:03:10 +0000 (+0000) Subject: #6513: fix example code: warning categories are classes, not instances. X-Git-Tag: v2.7a1~746 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b4d0ef91a5e94ad10707909d688e26513d62e0cc;p=thirdparty%2FPython%2Fcpython.git #6513: fix example code: warning categories are classes, not instances. --- diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst index d36955f6376a..8fa695274e90 100644 --- a/Doc/library/warnings.rst +++ b/Doc/library/warnings.rst @@ -204,7 +204,7 @@ check:: fxn() # Verify some things assert len(w) == 1 - assert isinstance(w[-1].category, DeprecationWarning) + assert issubclass(w[-1].category, DeprecationWarning) assert "deprecated" in str(w[-1].message) One can also cause all warnings to be exceptions by using ``error`` instead of