diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-10-09 12:54:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-09 12:54:20 -0700 |
commit | 459a4db5eae1f5ef063b34c61cc099820aa9ed0a (patch) | |
tree | 8fb279e9cbd6afd8b1afa1797e8f46f288abf68d /Lib/shelve.py | |
parent | e086bfee035eb23397f3cddba07b767b35d7ec08 (diff) | |
download | cpython-git-459a4db5eae1f5ef063b34c61cc099820aa9ed0a.tar.gz |
bpo-45353: Remind sys.modules users to copy when iterating. (GH-28842)
This is true of all dictionaries in Python, but this one tends to
catch people off guard as they don't realize when sys.modules might
change out from underneath them as a hidden side effect of their
code. Copying it first avoids the RuntimeError. An example when
this happens in single threaded code are codecs being loaded which
are an implicit time of use import that most need not think about.
(cherry picked from commit 3d1ca867ed0e3ae343166806f8ddd9739e568ab4)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Diffstat (limited to 'Lib/shelve.py')
0 files changed, 0 insertions, 0 deletions