[Python-checkins] r74074 - python/trunk/Doc/library/warnings.rst

georg.brandl python-checkins at python.org
Sat Jul 18 11:03:10 CEST 2009


Author: georg.brandl
Date: Sat Jul 18 11:03:10 2009
New Revision: 74074

Log:
#6513: fix example code: warning categories are classes, not instances.

Modified:
   python/trunk/Doc/library/warnings.rst

Modified: python/trunk/Doc/library/warnings.rst
==============================================================================
--- python/trunk/Doc/library/warnings.rst	(original)
+++ python/trunk/Doc/library/warnings.rst	Sat Jul 18 11:03:10 2009
@@ -204,7 +204,7 @@
         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


More information about the Python-checkins mailing list