This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author efroemling
Recipients efroemling
Date 2020-11-02.20:46:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org>
In-reply-to
Content
I've run into an issue where exceptions thrown by Enum constructors are keeping my objects alive. The underlying issue seems to be the same as https://bugs.python.org/issue36820

The same method used to fix the issue above seems to work here: simply adding a try/finally clause around the error handling at the end of enum.Enum.__new__() which sets ve_exc and exc to None does the trick.

I've attached a short script which demonstrates the issue. I realize that the cyclic garbage collector will eventually handle this case, but its a bummer to lose determinism in the destruction of my objects.

I'd be happy to create a PR for this or whatever I can do to help; just let me know if I should (I'm new here).
History
Date User Action Args
2020-11-02 20:46:49efroemlingsetrecipients: + efroemling
2020-11-02 20:46:49efroemlingsetmessageid: <1604350009.17.0.208770748804.issue42248@roundup.psfhosted.org>
2020-11-02 20:46:49efroemlinglinkissue42248 messages
2020-11-02 20:46:49efroemlingcreate