summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_tarfile.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-23 20:15:14 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-23 20:15:14 (GMT)
commit605c29303133987a5a97f3ceb4a369e9771676b0 (patch)
tree6d14f8ca8548f2696b8fd026c2bce94801975a5b /Lib/test/test_tarfile.py
parentb09a3d69a614c767653a12428d1ac816f516f36e (diff)
downloadcpython-605c29303133987a5a97f3ceb4a369e9771676b0.zip
cpython-605c29303133987a5a97f3ceb4a369e9771676b0.tar.gz
cpython-605c29303133987a5a97f3ceb4a369e9771676b0.tar.bz2
Further tarfile / test_tarfile cleanup
Diffstat (limited to 'Lib/test/test_tarfile.py')
-rw-r--r--Lib/test/test_tarfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index a51b512..3a217dc 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -423,7 +423,8 @@ class DetectReadTest(unittest.TestCase):
def _testfunc_fileobj(self, name, mode):
try:
- tar = tarfile.open(name, mode, fileobj=open(name, "rb"))
+ with open(name, "rb") as f:
+ tar = tarfile.open(name, mode, fileobj=f)
except tarfile.ReadError as e:
self.fail()
else: