gh-112069: Add _PySet_NextEntryRef to be thread-safe. (gh-117990)

This commit is contained in:
Donghee Na 2024-04-19 00:18:22 +09:00 committed by GitHub
parent 40f4d641a9
commit 94444ea45a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 76 additions and 34 deletions

View file

@ -2910,6 +2910,7 @@ _Py_DumpExtensionModules(int fd, PyInterpreterState *interp)
Py_ssize_t i = 0;
PyObject *item;
Py_hash_t hash;
// if stdlib_module_names is not NULL, it is always a frozenset.
while (_PySet_NextEntry(stdlib_module_names, &i, &item, &hash)) {
if (PyUnicode_Check(item)
&& PyUnicode_Compare(key, item) == 0)