Commits

Andrew Kuchling committed 25cc616

[Jython patch #1599050] Avoid crash when os module lacks fstat()

Comments (0)

Files changed (1)

                     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,