diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-11-20 18:24:54 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-11-20 18:24:54 (GMT) |
commit | b8bc439b2093add9b313bcca2cc507a2d0e87764 (patch) | |
tree | 904e57d63a3a2e90b4c3fc9074e8bfb8d2d2d68e /Lib/subprocess.py | |
parent | 44454afbe32c3d7e7c51c5c6835c79bc0e7fe948 (diff) | |
download | cpython-b8bc439b2093add9b313bcca2cc507a2d0e87764.zip cpython-b8bc439b2093add9b313bcca2cc507a2d0e87764.tar.gz cpython-b8bc439b2093add9b313bcca2cc507a2d0e87764.tar.bz2 |
don't shadow globals
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index b40d2a8..192185d 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1193,11 +1193,11 @@ class Popen(object): 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 @@ class Popen(object): 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) |