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 Dennis Sweeney
Recipients Dennis Sweeney, idan57
Date 2021-10-03.16:15:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633277717.07.0.850951364074.issue45353@roundup.psfhosted.org>
In-reply-to
Content
One standard way of preventing this is copying the dictionary whenever there's risk of it changing out from under you, as in:

modules = sys.modules.copy()
for key, value in modules.items():
    ...
History
Date User Action Args
2021-10-03 16:15:17Dennis Sweeneysetrecipients: + Dennis Sweeney, idan57
2021-10-03 16:15:17Dennis Sweeneysetmessageid: <1633277717.07.0.850951364074.issue45353@roundup.psfhosted.org>
2021-10-03 16:15:17Dennis Sweeneylinkissue45353 messages
2021-10-03 16:15:17Dennis Sweeneycreate