]> granicus.if.org Git - python/commitdiff
#22315: Use advertised API for OSError
authorJason R. Coombs <jaraco@jaraco.com>
Sun, 31 Aug 2014 21:42:20 +0000 (17:42 -0400)
committerJason R. Coombs <jaraco@jaraco.com>
Sun, 31 Aug 2014 21:42:20 +0000 (17:42 -0400)
Lib/distutils/dir_util.py

index 9879b0dc07c80d9086309af62bc8319315e7269e..0924c9b0f75bf35ba4c359d709446432a6368f8d 100644 (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)