Commit 3a815807 authored by Senthil Kumaran's avatar Senthil Kumaran

Fix the ResourceWarning in test_urllib.py due changes made for #16301. Patch by Berker Peksag

parent a212114a
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment