]> granicus.if.org Git - python/commitdiff
Fix the ResourceWarning in test_urllib.py due changes made for #16301. Patch by Berke...
authorSenthil Kumaran <senthil@uthcode.com>
Tue, 23 Oct 2012 00:06:43 +0000 (17:06 -0700)
committerSenthil Kumaran <senthil@uthcode.com>
Tue, 23 Oct 2012 00:06:43 +0000 (17:06 -0700)
Lib/test/test_urllib.py

index e2d306fc2891cd82edc01b2aa228901af4567d6f..276568dad4eafa73ef549dbe03a49e6e0f58ebcc 100644 (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))