Josh Rosenberg <shadowranger+pyt...@gmail.com> added the comment:
The problem is a lot simpler than you're making it: 1. You submit a time.sleep(30) task. This begins running immediately 2. You try to submit another task, but a NameError is raised, bypassing the rest of the code (you never call as_completed, with or without a timeout) 3. The ThreadPoolExecutor's __exit__ is invoked, which implicitly invokes shutdown(wait=True). This does not return until the successfully submitted task (time.sleep(30)) finished. 4. At that point, the exception that was interrupted by with statement cleanup resumes bubbling All of this is behaving exactly as documented, no bug is occurring. ---------- nosy: +josh.r resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41694> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com