Changes in anticipation of stricter str vs. bytes enforcement.

This commit is contained in:
Guido van Rossum 2007-08-27 20:40:10 +00:00
parent 739e2ad64b
commit 09549f4407
9 changed files with 97 additions and 115 deletions

View file

@ -318,11 +318,11 @@ class ComplexTest(unittest.TestCase):
fo = None
try:
fo = open(test_support.TESTFN, "wb")
fo = open(test_support.TESTFN, "w")
print(a, b, file=fo)
fo.close()
fo = open(test_support.TESTFN, "rb")
self.assertEqual(fo.read(), ("%s %s\n" % (a, b)).encode("ascii"))
fo = open(test_support.TESTFN, "r")
self.assertEqual(fo.read(), ("%s %s\n" % (a, b)))
finally:
if (fo is not None) and (not fo.closed):
fo.close()