[Python-checkins] r86595 - python/branches/py3k/Lib/subprocess.py

benjamin.peterson python-checkins at python.org
Sat Nov 20 19:24:55 CET 2010


Author: benjamin.peterson
Date: Sat Nov 20 19:24:54 2010
New Revision: 86595

Log:
don't shadow globals

Modified:
   python/branches/py3k/Lib/subprocess.py

Modified: python/branches/py3k/Lib/subprocess.py
==============================================================================
--- python/branches/py3k/Lib/subprocess.py	(original)
+++ python/branches/py3k/Lib/subprocess.py	Sat Nov 20 19:24:54 2010
@@ -1193,11 +1193,11 @@
                                 try:
                                     exc_type, exc_value = sys.exc_info()[:2]
                                     if isinstance(exc_value, OSError):
-                                        errno = exc_value.errno
+                                        errno_num = exc_value.errno
                                     else:
-                                        errno = 0
+                                        errno_num = 0
                                     message = '%s:%x:%s' % (exc_type.__name__,
-                                                            errno, exc_value)
+                                                            errno_num, exc_value)
                                     message = message.encode(errors="surrogatepass")
                                     os.write(errpipe_write, message)
                                 except Exception:
@@ -1252,12 +1252,12 @@
                         os.close(fd)
                 err_msg = err_msg.decode(errors="surrogatepass")
                 if issubclass(child_exception_type, OSError) and hex_errno:
-                    errno = int(hex_errno, 16)
-                    if errno != 0:
-                        err_msg = os.strerror(errno)
-                        if errno == errno.ENOENT:
+                    errno_num = int(hex_errno, 16)
+                    if errno_num != 0:
+                        err_msg = os.strerror(errno_num)
+                        if errno_num == errno.ENOENT:
                             err_msg += ': ' + repr(args[0])
-                    raise child_exception_type(errno, err_msg)
+                    raise child_exception_type(errno_num, err_msg)
                 raise child_exception_type(err_msg)
 
 


More information about the Python-checkins mailing list