Commit b9c044b8 by James Cammarata

Making the exception caught during os.dup of stdin explicit

Related to f23bb344
parent f23bb344
...@@ -511,7 +511,7 @@ class Runner(object): ...@@ -511,7 +511,7 @@ class Runner(object):
if not new_stdin and fileno is not None: if not new_stdin and fileno is not None:
try: try:
self._new_stdin = os.fdopen(os.dup(fileno)) self._new_stdin = os.fdopen(os.dup(fileno))
except: except OSError, e:
# couldn't dupe stdin, most likely because it's # couldn't dupe stdin, most likely because it's
# not a valid file descriptor, so we just rely on # not a valid file descriptor, so we just rely on
# using the one that was passed in # using the one that was passed in
...@@ -1103,7 +1103,7 @@ class Runner(object): ...@@ -1103,7 +1103,7 @@ class Runner(object):
if fileno is not None: if fileno is not None:
try: try:
new_stdin = os.fdopen(os.dup(fileno)) new_stdin = os.fdopen(os.dup(fileno))
except: except OSError, e:
# couldn't dupe stdin, most likely because it's # couldn't dupe stdin, most likely because it's
# not a valid file descriptor, so we just rely on # not a valid file descriptor, so we just rely on
# using the one that was passed in # using the one that was passed in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment