From: Senthil Kumaran Date: Thu, 12 Apr 2012 11:28:07 +0000 (+0800) Subject: code improvement. 'as cm' not required when not used. Review comment by Georg Brandl X-Git-Tag: v3.3.0a3~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=80a133b91c857f6da41c6eba3b6992af6d696347;p=python code improvement. 'as cm' not required when not used. Review comment by Georg Brandl --- diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py index 9d9260ab3d..fad95cc70e 100644 --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py @@ -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()