mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
More proper closing of files
This commit is contained in:
parent
73315e9200
commit
92f60ed82a
7 changed files with 82 additions and 57 deletions
|
@ -48,8 +48,8 @@ class Test_MultibyteCodec(unittest.TestCase):
|
|||
def test_codingspec(self):
|
||||
try:
|
||||
for enc in ALL_CJKENCODINGS:
|
||||
print('# coding:', enc, file=io.open(TESTFN, 'w'))
|
||||
exec(open(TESTFN).read())
|
||||
code = '# coding: {}\n'.format(enc)
|
||||
exec(code)
|
||||
finally:
|
||||
support.unlink(TESTFN)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue