New submission from Idan Cohen :
Hi,
When iterating over sys.modules it might be that because of lazy loading or
that other module reload is being reloaded (even if sys.modules.copy() is being
used) you will get:
"RuntimeError: dictionary changed size during iteration"
Th
Idan Cohen added the comment:
An example can be found here:
https://github.com/python/cpython/commit/7058d2d96c5ca4dfc6c754c5cd737c6eb2a8fd67
https://bugs.python.org/issue13487
Those links are about an issue that was until March 2020 with how sys.modules
is iterated. It is not safe to