From 311321edc15d4062babf757e3827341633353d55 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 31 Aug 2014 17:42:20 -0400 Subject: #22315: Use advertised API for OSError --- Lib/distutils/dir_util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py index 9879b0d..0924c9b 100644 --- a/Lib/distutils/dir_util.py +++ b/Lib/distutils/dir_util.py @@ -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) -- cgit v0.12