summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_multibytecodec.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-10-14 22:22:30 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-10-14 22:22:30 (GMT)
commit99d848bd4ba7bc0df689709f3854d67c6d82a757 (patch)
treed02592b257cb7411854f5f49e904b054af391a90 /Lib/test/test_multibytecodec.py
parent80800d35713912eb4b9486033c1ce86bce263728 (diff)
downloadcpython-99d848bd4ba7bc0df689709f3854d67c6d82a757.zip
cpython-99d848bd4ba7bc0df689709f3854d67c6d82a757.tar.gz
cpython-99d848bd4ba7bc0df689709f3854d67c6d82a757.tar.bz2
Merged revisions 85503 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85503 | antoine.pitrou | 2010-10-15 00:11:44 +0200 (ven., 15 oct. 2010) | 2 lines More proper closing of files ........
Diffstat (limited to 'Lib/test/test_multibytecodec.py')
-rw-r--r--Lib/test/test_multibytecodec.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index 95ca0ab..63c1e62 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -46,12 +46,9 @@ class Test_MultibyteCodec(unittest.TestCase):
'apple\x92ham\x93spam', 'test.cjktest')
def test_codingspec(self):
- try:
- for enc in ALL_CJKENCODINGS:
- print >> open(TESTFN, 'w'), '# coding:', enc
- exec open(TESTFN)
- finally:
- os.unlink(TESTFN)
+ for enc in ALL_CJKENCODINGS:
+ code = '# coding: {}\n'.format(enc)
+ exec code
def test_init_segfault(self):
# bug #3305: this used to segfault