mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
#22315: Use advertised API for OSError
This commit is contained in:
parent
d28c5f00ef
commit
311321edc1
1 changed files with 1 additions and 2 deletions
|
|
@ -125,12 +125,11 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
|
||||||
try:
|
try:
|
||||||
names = os.listdir(src)
|
names = os.listdir(src)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
(errno, errstr) = e
|
|
||||||
if dry_run:
|
if dry_run:
|
||||||
names = []
|
names = []
|
||||||
else:
|
else:
|
||||||
raise DistutilsFileError(
|
raise DistutilsFileError(
|
||||||
"error listing files in '%s': %s" % (src, errstr))
|
"error listing files in '%s': %s" % (src, e.strerror))
|
||||||
|
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
mkpath(dst, verbose=verbose)
|
mkpath(dst, verbose=verbose)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue