summaryrefslogtreecommitdiff
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
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))