mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Changes in anticipation of stricter str vs. bytes enforcement.
This commit is contained in:
parent
739e2ad64b
commit
09549f4407
9 changed files with 97 additions and 115 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue