From 3916f03e0742942b7730739510b7579c47e86cc7 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Tue, 8 May 2018 10:15:00 +0000 Subject: [PATCH] Indexing exceptions will not work on Python 3 --- whipper/extern/asyncsub.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/whipper/extern/asyncsub.py b/whipper/extern/asyncsub.py index 49eab28..3ee0fef 100644 --- a/whipper/extern/asyncsub.py +++ b/whipper/extern/asyncsub.py @@ -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