From: Andrew M. Kuchling Date: Thu, 14 Dec 2006 18:59:07 +0000 (+0000) Subject: [Patch #1599256 from David Watson] check that os.fsync is available before using it X-Git-Tag: v2.5.1c1~217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a75d31619c75854e45ad20918e4300efe7507767;p=python [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 108d874fe0..f9af494956 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."""