summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2012-10-22 17:06:43 -0700
committerSenthil Kumaran <senthil@uthcode.com>2012-10-22 17:06:43 -0700
commit3a8158071929ad1a1e58d1540dab21d44b2fdb61 (patch)
tree51057a2e444d06f4c9b6d925debb71ff2a3a232b /Lib/test/test_urllib.py
parenta212114a966c2c43de7f7f4404050018119c8dc0 (diff)
downloadcpython-git-3a8158071929ad1a1e58d1540dab21d44b2fdb61.tar.gz
Fix the ResourceWarning in test_urllib.py due changes made for #16301. Patch by Berker Peksag
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index e2d306fc28..276568dad4 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -280,7 +280,8 @@ Content-Type: text/html; charset=iso-8859-1
tmp_fileurl = 'file://localhost' + tmp_file
self.assertTrue(os.path.exists(tmp_file))
- self.assertTrue(urlopen(tmp_fileurl))
+ with urlopen(tmp_fileurl) as fobj:
+ self.assertTrue(fobj)
os.unlink(tmp_file)
self.assertFalse(os.path.exists(tmp_file))