[pypy-commit] pypy default: Fix the test to properly close() the file.
arigo
noreply at buildbot.pypy.org
Mon Aug 1 18:08:41 CEST 2011
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r46160:efee3187f6ff
Date: 2011-08-01 17:50 +0200
http://bitbucket.org/pypy/pypy/changeset/efee3187f6ff/
Log: Fix the test to properly close() the file.
diff --git a/lib-python/modified-2.7/test/test_multibytecodec.py b/lib-python/modified-2.7/test/test_multibytecodec.py
--- a/lib-python/modified-2.7/test/test_multibytecodec.py
+++ b/lib-python/modified-2.7/test/test_multibytecodec.py
@@ -148,7 +148,8 @@
class Test_StreamReader(unittest.TestCase):
def test_bug1728403(self):
try:
- open(TESTFN, 'w').write('\xa1')
+ with open(TESTFN, 'w') as f:
+ f.write('\xa1')
f = codecs.open(TESTFN, encoding='cp949')
self.assertRaises(UnicodeDecodeError, f.read, 2)
finally:
More information about the pypy-commit
mailing list