Fix file test.
This commit is contained in:
parent
29478ef990
commit
c02571484b
|
@ -327,7 +327,7 @@ class ComplexTest(unittest.TestCase):
|
||||||
print(a, b, file=fo)
|
print(a, b, file=fo)
|
||||||
fo.close()
|
fo.close()
|
||||||
fo = open(test_support.TESTFN, "rb")
|
fo = open(test_support.TESTFN, "rb")
|
||||||
self.assertEqual(fo.read(), "%s %s\n" % (a, b))
|
self.assertEqual(fo.read(), bytes("%s %s\n" % (a, b)))
|
||||||
finally:
|
finally:
|
||||||
if (fo is not None) and (not fo.closed):
|
if (fo is not None) and (not fo.closed):
|
||||||
fo.close()
|
fo.close()
|
||||||
|
|
Loading…
Reference in New Issue