]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Correct a couple of errors in the updated catch_warning documentation (the Py3k versi...
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 13 Jul 2008 12:36:42 +0000 (12:36 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 13 Jul 2008 12:36:42 +0000 (12:36 +0000)
Doc/library/test.rst

index 46d21ccae45d7b0ef56f3f7e82e7911c08b74d1a..4c957599e15c7d1eebc5cfb7dcc2ca43571ca297 100644 (file)
@@ -305,9 +305,9 @@ The :mod:`test.test_support` module defines the following functions:
       with catch_warning() as w:
           warnings.simplefilter("always")
           warnings.warn("foo")
-          assert w.last == "foo"
+          assert str(w.message) == "foo"
           warnings.warn("bar")
-          assert w.last == "bar"
+          assert str(w.message) == "bar"
           assert str(w.warnings[0].message) == "foo"
           assert str(w.warnings[1].message) == "bar"