The session.run() function has no path for a non-coroutine function being passed in, it'll simply return without calling twisted.react():
|
def run(self, f): |
|
# Python 3 only. |
|
if hasattr(inspect, 'iscoroutinefunction'): |
|
# Is this a coroutine? |
|
if inspect.iscoroutinefunction(f): |
|
def w(reactor): |
|
return self.wrap(f()) |
|
# If so, convert coroutine to Deferred automatically. |
|
return task.react(w) |
|
else: |
|
# Otherwise, run the Deferred. |
|
return task.react(f) |
Under Python 3, line 63 is True, but if line 65 is False (so f is not a coroutine function) , the function ends. Should the else on line 70 be dropped, and lines 71 and 72 unindented?
The
session.run()function has no path for a non-coroutine function being passed in, it'll simply return without callingtwisted.react():requests-threads/requests_threads.py
Lines 61 to 72 in b4d4384
Under Python 3, line 63 is
True, but if line 65 isFalse(sofis not a coroutine function) , the function ends. Should theelseon line 70 be dropped, and lines 71 and 72 unindented?