Dennis Sweeney <sweeney.dennis...@gmail.com> added the comment:

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():
    ...

----------
nosy: +Dennis Sweeney

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45353>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to