]> granicus.if.org Git - python/commitdiff
Issue #5695: Minor tweak to improve the code as suggested by Brett Cannon and as...
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 7 Apr 2009 17:18:24 +0000 (17:18 +0000)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Tue, 7 Apr 2009 17:18:24 +0000 (17:18 +0000)
Lib/test/test_logging.py

index 72dded5f8236ed406287d2891d86ad006f556d19..adeee7d853f3b4c48fbc3502ab14c3fc33e4090f 100644 (file)
@@ -914,8 +914,8 @@ class WarningsTest(BaseTest):
     def test_warnings(self):
         with warnings.catch_warnings():
             logging.captureWarnings(True)
-            warnings.filterwarnings("always", category=UserWarning)
             try:
+                warnings.filterwarnings("always", category=UserWarning)
                 file = cStringIO.StringIO()
                 h = logging.StreamHandler(file)
                 logger = logging.getLogger("py.warnings")