Commit fc473b32 by James Tanner

Fixes #5146 Handle missing stdin when running under celery with rabbitmq or redis

parent 89abc35e
...@@ -405,8 +405,13 @@ class Runner(object): ...@@ -405,8 +405,13 @@ class Runner(object):
return flags return flags
try: try:
if not new_stdin: fileno = sys.stdin.fileno()
self._new_stdin = os.fdopen(os.dup(sys.stdin.fileno())) except ValueError:
fileno = None
try:
if not new_stdin and fileno is not None:
self._new_stdin = os.fdopen(os.dup(fileno))
else: else:
self._new_stdin = new_stdin self._new_stdin = new_stdin
......
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