X Tutup
Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
79f39a4
Add _Py_ext_module_loader_result.singlephase.
ericsnowcurrently Apr 16, 2024
aa78a49
res.singlephase -> res.kind
ericsnowcurrently Apr 17, 2024
938e50f
Add _Py_ext_module_loader_result.err.
ericsnowcurrently Apr 16, 2024
9383ce1
fix error case
ericsnowcurrently Apr 16, 2024
62166ae
Add some asserts to _PyImport_RunModInitFunc().
ericsnowcurrently Apr 18, 2024
4881119
Check the module returned by import_find_extension() to ensure single…
ericsnowcurrently Apr 18, 2024
9010c2c
Relax the error check.
ericsnowcurrently Apr 24, 2024
b08c5f5
Use an enum instead of storing an error string.
ericsnowcurrently Apr 24, 2024
8efc29f
_Py_ext_module_loader_result_kind -> _Py_ext_module_kind
ericsnowcurrently Apr 29, 2024
0359bae
Fix is_singlephase().
ericsnowcurrently Apr 29, 2024
87e6bbc
Return UNKNOWN from get_extension_kind().
ericsnowcurrently Apr 29, 2024
8622c28
Add a comment.
ericsnowcurrently Apr 29, 2024
7c7e654
Set m_init in update_global_state_for_extension().
ericsnowcurrently Apr 29, 2024
4406192
Expand the cases in get_extension_kind().
ericsnowcurrently Apr 29, 2024
ae3e770
Add check_multiphase_preinit().
ericsnowcurrently Apr 29, 2024
e94a082
Add a _Py_ext_module_kind typedef.
ericsnowcurrently May 1, 2024
4e1f308
check_singlephase() -> assert_singlephase()
ericsnowcurrently May 1, 2024
aa1edc9
Split up an assert.
ericsnowcurrently May 1, 2024
cd365ec
Set __file__ in the reload case.
ericsnowcurrently May 1, 2024
da1f91f
Split up other asserts.
ericsnowcurrently May 1, 2024
c2a687c
Clear the stolen exception.
ericsnowcurrently May 1, 2024
211dab3
Call _Py_ext_module_loader_result_clear() in _Py_ext_module_loader_re…
ericsnowcurrently May 1, 2024
fca9857
Clarify the comment about modules sharing a def.
ericsnowcurrently May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some asserts to _PyImport_RunModInitFunc().
  • Loading branch information
ericsnowcurrently committed Apr 29, 2024
commit 62166ae5975bd5929f1cf1296e8deffa2495dc9c
3 changes: 2 additions & 1 deletion Python/importdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ _PyImport_RunModInitFunc(PyModInitFunction p0,

res.def = _PyModule_GetDef(m);
if (res.def == NULL) {
PyErr_Clear();
SET_ERROR("initialization of %s did not return a valid extension "
"module", name_buf);
goto error;
Expand All @@ -357,7 +358,7 @@ _PyImport_RunModInitFunc(PyModInitFunction p0,
return 0;

error:
assert(PyErr_Occurred() || res.err[0] != '\0');
assert((PyErr_Occurred() == NULL) != (res.err[0] == '\0'));
Py_CLEAR(res.module);
res.def = NULL;
*p_res = res;
Expand Down
X Tutup