[Python-checkins] r52824 - python/branches/release23-maint/Lib/fileinput.py

andrew.kuchling python-checkins at python.org
Wed Nov 22 20:50:21 CET 2006


Author: andrew.kuchling
Date: Wed Nov 22 20:50:21 2006
New Revision: 52824
Modified:
 python/branches/release23-maint/Lib/fileinput.py
Log:
[Jython patch #1599050] Avoid crash when os module lacks fstat()
Modified: python/branches/release23-maint/Lib/fileinput.py
==============================================================================
--- python/branches/release23-maint/Lib/fileinput.py	(original)
+++ python/branches/release23-maint/Lib/fileinput.py	Wed Nov 22 20:50:21 2006
@@ -301,7 +301,9 @@
 self._file = open(self._backupfilename, "r")
 try:
 perm = os.fstat(self._file.fileno()).st_mode
- except OSError:
+ except (AttributeError, OSError):
+			# AttributeError occurs in Jython, where there's no
+			# os.fstat.
 self._output = open(self._filename, "w")
 else:
 fd = os.open(self._filename,


More information about the Python-checkins mailing list

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