diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-12-14 18:57:53 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-12-14 18:57:53 (GMT) |
commit | 1646568b5ed4a3d11e1bf938048b01d7ae3dd0f7 (patch) | |
tree | 89eecd4f738b2c86e4489b0eb06f43ea6160ab8d | |
parent | 76fdb8c050078b7c2d008b65d8409b8f191b1de9 (diff) | |
download | cpython-1646568b5ed4a3d11e1bf938048b01d7ae3dd0f7.zip cpython-1646568b5ed4a3d11e1bf938048b01d7ae3dd0f7.tar.gz cpython-1646568b5ed4a3d11e1bf938048b01d7ae3dd0f7.tar.bz2 |
[Patch #1599256 from David Watson] check that os.fsync is available before using it
-rwxr-xr-x | Lib/mailbox.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 _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.""" |