-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
The session.run() function has no path for a non-coroutine function being passed in, it'll simply return without calling twisted.react():
requests-threads/requests_threads.py
Lines 61 to 72 in b4d4384
| 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?
Metadata
Metadata
Assignees
Labels
No labels