mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
[Patch #1599256 from David Watson] check that os.fsync is available before using it
This commit is contained in:
parent
4d7ad63210
commit
a75d31619c
1 changed files with 2 additions and 1 deletions
|
@ -1887,6 +1887,7 @@ def _create_temporary(path):
|
||||||
def _sync_flush(f):
|
def _sync_flush(f):
|
||||||
"""Ensure changes to file f are physically on disk."""
|
"""Ensure changes to file f are physically on disk."""
|
||||||
f.flush()
|
f.flush()
|
||||||
|
if hasattr(os, 'fsync'):
|
||||||
os.fsync(f.fileno())
|
os.fsync(f.fileno())
|
||||||
|
|
||||||
def _sync_close(f):
|
def _sync_close(f):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue