Issue #22182: Use e.args to unpack exceptions correctly in distutils.file_util.move_file.

Patch by Claudiu Popa.
This commit is contained in:
Berker Peksag 2014-08-29 07:07:35 +03:00
parent 59e0802301
commit 6685883c02
3 changed files with 25 additions and 2 deletions

View file

@ -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: