Skip to content

Commit 928f23b

Browse files
committed
_PyModule_GetDefOrNull never raises
1 parent 66e8309 commit 928f23b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/import.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,9 +2294,8 @@ _PyImport_FixupBuiltin(PyThreadState *tstate, PyObject *mod, const char *name,
22942294

22952295
PyModuleDef *def = _PyModule_GetDefOrNull(mod);
22962296
if (def == NULL) {
2297-
if (!PyErr_Occurred()) {
2298-
PyErr_BadInternalCall();
2299-
}
2297+
assert(!PyErr_Occurred());
2298+
PyErr_BadInternalCall();
23002299
goto finally;
23012300
}
23022301

0 commit comments

Comments
 (0)