Author gsakkis
Recipients gsakkis
Date 2020-11-19.15:02:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Content prevents interpreter exit if there is a reference to the generator it returns. In the attached script:

- `python run1` exits as soon as the exception is raised on the main thread. This is the desired behavior in our case.

- `python run2` keeps running until the thread worker processes all queued work items. The only difference from `run1` is that the result of `` is assigned to a variable.

- `python run3` has a `finally` block that shuts down the executor without waiting. Still the worker thread keeps running even after the shutdown.

Initially it seemed like but there is no change in the behavior after commenting out the `atexit.register(_python_exit)` call (for the `run2` case at least).
Date User Action Args
2020-11-19 15:02:33gsakkissetrecipients: + gsakkis
2020-11-19 15:02:33gsakkissetmessageid: <>
2020-11-19 15:02:33gsakkislinkissue42409 messages
2020-11-19 15:02:33gsakkiscreate