]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#6513: fix example code: warning categories are classes, not instances.
authorGeorg Brandl <georg@python.org>
Sat, 18 Jul 2009 09:03:10 +0000 (09:03 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 18 Jul 2009 09:03:10 +0000 (09:03 +0000)
Doc/library/warnings.rst

index d36955f6376ab30b3258ada26f3a4cc3356f0d6c..8fa695274e90b08c299b977dccef099d7e259814 100644 (file)
@@ -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