Issue #5695: Minor tweak to improve the code as suggested by Brett Cannon and as implemented in the Py3K branch.
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 72dded5..adeee7d 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -914,8 +914,8 @@
     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")