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

This commit is contained in:
Senthil Kumaran 2012-10-22 17:06:43 -07:00
parent a212114a96
commit 3a81580719
1 changed files with 2 additions and 1 deletions

View File

@ -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))