mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
Issue #16706: get rid of os.error
This commit is contained in:
parent
a191959849
commit
ad28c7f9da
33 changed files with 4089 additions and 4123 deletions
|
@ -324,8 +324,10 @@ class FileInput:
|
|||
if self._inplace:
|
||||
self._backupfilename = (
|
||||
self._filename + (self._backup or ".bak"))
|
||||
try: os.unlink(self._backupfilename)
|
||||
except os.error: pass
|
||||
try:
|
||||
os.unlink(self._backupfilename)
|
||||
except OSError:
|
||||
pass
|
||||
# The next few lines may raise IOError
|
||||
os.rename(self._filename, self._backupfilename)
|
||||
self._file = open(self._backupfilename, self._mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue