[Python-checkins] cpython (3.4): #22315: Use advertised API for OSError

jason.coombs python-checkins at python.org
Mon Sep 1 00:03:00 CEST 2014


http://hg.python.org/cpython/rev/75a5cc4ef31c
changeset:   92289:75a5cc4ef31c
branch:      3.4
user:        Jason R. Coombs <jaraco at jaraco.com>
date:        Sun Aug 31 17:42:20 2014 -0400
summary:
  #22315: Use advertised API for OSError

files:
  Lib/distutils/dir_util.py |  3 +--
  1 files changed, 1 insertions(+), 2 deletions(-)


diff --git a/Lib/distutils/dir_util.py b/Lib/distutils/dir_util.py
--- a/Lib/distutils/dir_util.py
+++ b/Lib/distutils/dir_util.py
@@ -125,12 +125,11 @@
     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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list