mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.
Patch by Claudiu Popa.
This commit is contained in:
parent
59e0802301
commit
6685883c02
3 changed files with 25 additions and 2 deletions
|
@ -194,7 +194,7 @@ def move_file (src, dst,
|
|||
try:
|
||||
os.rename(src, dst)
|
||||
except OSError as e:
|
||||
(num, msg) = e
|
||||
(num, msg) = e.args
|
||||
if num == errno.EXDEV:
|
||||
copy_it = True
|
||||
else:
|
||||
|
@ -206,7 +206,7 @@ def move_file (src, dst,
|
|||
try:
|
||||
os.unlink(src)
|
||||
except OSError as e:
|
||||
(num, msg) = e
|
||||
(num, msg) = e.args
|
||||
try:
|
||||
os.unlink(dst)
|
||||
except OSError:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue