Add fixes to previous commit

This commit is contained in:
Justine Tunney 2022-05-13 05:05:27 -07:00
parent 83b743cf96
commit 77b70ba193
3 changed files with 7 additions and 4 deletions

View file

@ -2121,8 +2121,9 @@ def _create_temporary(path):
def _sync_flush(f):
"""Ensure changes to file f are physically on disk."""
f.flush()
if hasattr(os, 'fsync'):
os.fsync(f.fileno())
# TODO(jart): Why does this need fsync() lool?
#if hasattr(os, 'fsync'):
# os.fsync(f.fileno())
def _sync_close(f):
"""Close file f, ensuring all changes are physically on disk."""

View file

@ -71,8 +71,9 @@ class TestGzip(BaseTest):
# Try flush and fileno.
f.flush()
f.fileno()
if hasattr(os, 'fsync'):
os.fsync(f.fileno())
# TODO(jart): Why does this need fsync()?
#if hasattr(os, 'fsync'):
# os.fsync(f.fileno())
f.close()
# Test multiple close() calls.