]> granicus.if.org Git - python/commitdiff
code improvement. 'as cm' not required when not used. Review comment by Georg Brandl
authorSenthil Kumaran <senthil@uthcode.com>
Thu, 12 Apr 2012 11:28:07 +0000 (19:28 +0800)
committerSenthil Kumaran <senthil@uthcode.com>
Thu, 12 Apr 2012 11:28:07 +0000 (19:28 +0800)
Lib/test/test_urllib2.py

index 9d9260ab3dbff97242bc9d27184f1039b82dcc88..fad95cc70e0d3a214a3b48124a38dae8c6ed098c 100644 (file)
@@ -619,19 +619,19 @@ class OpenerDirectorTests(unittest.TestCase):
     def test_method_deprecations(self):
         req = Request("http://www.example.com")
 
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.add_data("data")
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.has_data()
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.get_data()
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.get_host()
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.get_selector()
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.is_unverifiable()
-        with self.assertWarns(DeprecationWarning) as cm:
+        with self.assertWarns(DeprecationWarning):
             req.get_origin_req_host()