commit | a75d31619c75854e45ad20918e4300efe7507767 | [log] [tgz] |
---|---|---|
author | Andrew M. Kuchling <amk@amk.ca> | Thu Dec 14 18:59:07 2006 +0000 |
committer | Andrew M. Kuchling <amk@amk.ca> | Thu Dec 14 18:59:07 2006 +0000 |
tree | 4f680cc55b003f5fcca462c2187d2ae872dbeabe | |
parent | 4d7ad63210e94b55021507efa07958563b0276b8 [diff] [blame] |
[Patch #1599256 from David Watson] check that os.fsync is available before using it
diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 108d874..f9af494 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py
@@ -1887,7 +1887,8 @@ 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."""