Commit 01dbd70d authored by Jason R. Coombs's avatar Jason R. Coombs

#22315: Use advertised API for OSError

parent 58b1aba4
...@@ -125,12 +125,11 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1, ...@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment