Indexing exceptions will not work on Python 3

This commit is contained in:
JoeLametta
2018-05-08 10:15:00 +00:00
parent 71df9124a6
commit 3916f03e07

View File

@@ -54,7 +54,7 @@ class Popen(subprocess.Popen):
except ValueError:
return self._close('stdin')
except (subprocess.pywintypes.error, Exception), why:
if why[0] in (109, errno.ESHUTDOWN):
if why.args[0] in (109, errno.ESHUTDOWN):
return self._close('stdin')
raise
@@ -75,7 +75,7 @@ class Popen(subprocess.Popen):
except ValueError:
return self._close(which)
except (subprocess.pywintypes.error, Exception), why:
if why[0] in (109, errno.ESHUTDOWN):
if why.args[0] in (109, errno.ESHUTDOWN):
return self._close(which)
raise
@@ -95,7 +95,7 @@ class Popen(subprocess.Popen):
try:
written = os.write(self.stdin.fileno(), input)
except OSError, why:
if why[0] == errno.EPIPE: # broken pipe
if why.args[0] == errno.EPIPE: # broken pipe
return self._close('stdin')
raise