mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Explicitly close some files (from issue #10093)
This commit is contained in:
parent
d9f57630fe
commit
b86680e299
6 changed files with 31 additions and 14 deletions
|
@ -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__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue