mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
#16135: Removal of OS/2 support (Python code partial cleanup)
This commit is contained in:
parent
f1af705720
commit
4791a24268
11 changed files with 20 additions and 89 deletions
|
@ -707,8 +707,7 @@ class _singlefileMailbox(Mailbox):
|
|||
try:
|
||||
os.rename(new_file.name, self._path)
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST or \
|
||||
(os.name == 'os2' and e.errno == errno.EACCES):
|
||||
if e.errno == errno.EEXIST:
|
||||
os.remove(self._path)
|
||||
os.rename(new_file.name, self._path)
|
||||
else:
|
||||
|
@ -2093,8 +2092,7 @@ def _lock_file(f, dotlock=True):
|
|||
os.rename(pre_lock.name, f.name + '.lock')
|
||||
dotlock_done = True
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST or \
|
||||
(os.name == 'os2' and e.errno == errno.EACCES):
|
||||
if e.errno == errno.EEXIST:
|
||||
os.remove(pre_lock.name)
|
||||
raise ExternalClashError('dot lock unavailable: %s' %
|
||||
f.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue