#22315: Use advertised API for OSError

This commit is contained in:
Jason R. Coombs 2014-08-31 17:42:20 -04:00
parent d28c5f00ef
commit 311321edc1
1 changed files with 1 additions and 2 deletions

View File

@ -125,12 +125,11 @@ def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
try:
names = os.listdir(src)
except OSError as e:
(errno, errstr) = e
if dry_run:
names = []
else:
raise DistutilsFileError(
"error listing files in '%s': %s" % (src, errstr))
"error listing files in '%s': %s" % (src, e.strerror))
if not dry_run:
mkpath(dst, verbose=verbose)