[Python-checkins] r53033 - python/branches/release25-maint/Lib/mailbox.py

andrew.kuchling python-checkins at python.org
Thu Dec 14 19:59:08 CET 2006


Author: andrew.kuchling
Date: Thu Dec 14 19:59:07 2006
New Revision: 53033
Modified:
 python/branches/release25-maint/Lib/mailbox.py
Log:
[Patch #1599256 from David Watson] check that os.fsync is available before using it
Modified: python/branches/release25-maint/Lib/mailbox.py
==============================================================================
--- python/branches/release25-maint/Lib/mailbox.py	(original)
+++ python/branches/release25-maint/Lib/mailbox.py	Thu Dec 14 19:59:07 2006
@@ -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."""


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /