https://github.com/python/cpython/commit/e8b5cb8f33caeb779c6e2a59776ea62bd8c684d2
commit: e8b5cb8f33caeb779c6e2a59776ea62bd8c684d2
branch: main
author: Itamar Oren <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2025-10-27T15:18:58+02:00
summary:

gh-140641: Break out of inittab search on match (GH-140642)

files:
M Python/import.c

diff --git a/Python/import.c b/Python/import.c
index d01c4d478283ff..45206b46793846 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2358,6 +2358,7 @@ create_builtin(PyThreadState *tstate, PyObject *name, 
PyObject *spec)
     for (struct _inittab *p = INITTAB; p->name != NULL; p++) {
         if (_PyUnicode_EqualToASCIIString(info.name, p->name)) {
             found = p;
+            break;
         }
     }
     if (found == NULL) {

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to