diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-10-23 00:06:43 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-10-23 00:06:43 (GMT) |
commit | 3a8158071929ad1a1e58d1540dab21d44b2fdb61 (patch) | |
tree | 51057a2e444d06f4c9b6d925debb71ff2a3a232b /Lib/test/test_urllib.py | |
parent | a212114a966c2c43de7f7f4404050018119c8dc0 (diff) | |
download | cpython-3a8158071929ad1a1e58d1540dab21d44b2fdb61.zip cpython-3a8158071929ad1a1e58d1540dab21d44b2fdb61.tar.gz cpython-3a8158071929ad1a1e58d1540dab21d44b2fdb61.tar.bz2 |
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.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py index e2d306f..276568d 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)) |