[Python-checkins] cpython: code improvement. 'as cm' not required when not used. Review comment by Georg
senthil.kumaran
python-checkins at python.org
Thu Apr 12 13:28:32 CEST 2012
http://hg.python.org/cpython/rev/0f114b855824
changeset: 76262:0f114b855824
parent: 76260:bd353f12c007
user: Senthil Kumaran <senthil at uthcode.com>
date: Thu Apr 12 19:28:07 2012 +0800
summary:
code improvement. 'as cm' not required when not used. Review comment by Georg Brandl
files:
Lib/test/test_urllib2.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -619,19 +619,19 @@
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()
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list