summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_argparse.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:15:17 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-14 21:15:17 (GMT)
commitb86680e299d7429532518a496031cb96aa2ea659 (patch)
treec908511dfb569e7a640ed65cc412f1556f0ecc12 /Lib/test/test_argparse.py
parentd9f57630fed16bd1e97737f8afc22b5cc6645769 (diff)
downloadcpython-b86680e299d7429532518a496031cb96aa2ea659.zip
cpython-b86680e299d7429532518a496031cb96aa2ea659.tar.gz
cpython-b86680e299d7429532518a496031cb96aa2ea659.tar.bz2
Explicitly close some files (from issue #10093)
Diffstat (limited to 'Lib/test/test_argparse.py')
-rw-r--r--Lib/test/test_argparse.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
index cf0f8e4..f01c65f 100644
--- a/Lib/test/test_argparse.py
+++ b/Lib/test/test_argparse.py
@@ -4160,7 +4160,8 @@ class TestEncoding(TestCase):
def _test_module_encoding(self, path):
path, _ = os.path.splitext(path)
path += ".py"
- codecs.open(path, 'r', 'utf8').read()
+ with codecs.open(path, 'r', 'utf8') as f:
+ f.read()
def test_argparse_module_encoding(self):
self._test_module_encoding(argparse.__file__)