Kaydet (Commit) 1646568b authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

[Patch #1599256 from David Watson] check that os.fsync is available before using it

üst 76fdb8c0
......@@ -1887,7 +1887,8 @@ def _create_temporary(path):
def _sync_flush(f):
"""Ensure changes to file f are physically on disk."""
f.flush()
os.fsync(f.fileno())
if hasattr(os, 'fsync'):
os.fsync(f.fileno())
def _sync_close(f):
"""Close file f, ensuring all changes are physically on disk."""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment