mirror of https://github.com/python/cpython
Update the comment and remove the close. If we close we can't flush anymore.
We might still need to close after the for loop if flushing 6! times still doesn't cause the signal/exception.
This commit is contained in:
parent
41ada16cb7
commit
c5198090f3
|
@ -56,13 +56,12 @@ class ResourceTest(unittest.TestCase):
|
|||
f.flush()
|
||||
# On some systems (e.g., Ubuntu on hppa) the flush()
|
||||
# doesn't always cause the exception, but the close()
|
||||
# does eventually. Try closing several times in
|
||||
# does eventually. Try flushing several times in
|
||||
# an attempt to ensure the file is really synced and
|
||||
# the exception raised.
|
||||
for i in range(5):
|
||||
time.sleep(.1)
|
||||
f.flush()
|
||||
f.close()
|
||||
except IOError:
|
||||
if not limit_set:
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue