Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
fix CI
- remove unused `found` variable
- use `my_test_extension` instead of `embedded_ext` (the former is free-threading-ready, the latter prints a warning)
  • Loading branch information
itamaro committed Nov 9, 2025
commit 35e9e786a4920a67bf151125ff3ad256177e00db
2 changes: 1 addition & 1 deletion Lib/test/test_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def test_repeated_init_and_inittab(self):
def test_create_module_from_initfunc(self):
out, err = self.run_embedded_interpreter("test_create_module_from_initfunc")
self.assertEqual(err, "")
self.assertEqual(out, "<module 'embedded_ext' (static-extension)>\n")
self.assertEqual(out, "<module 'my_test_extension' (static-extension)>\n")

def test_forced_io_encoding(self):
# Checks forced configuration of embedded interpreter IO streams
Expand Down
6 changes: 3 additions & 3 deletions Programs/_testembed.c
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,7 @@ static int test_repeated_init_and_inittab(void)
}

static PyObject* create_module(PyObject* self, PyObject* spec) {
return PyImport_CreateModuleFromInitfunc(spec, PyInit_embedded_ext);
return PyImport_CreateModuleFromInitfunc(spec, init_my_test_extension);
}

static PyMethodDef create_static_module_methods[] = {
Expand All @@ -2236,7 +2236,7 @@ PyMODINIT_FUNC PyInit_create_static_module(void) {

static int test_create_module_from_initfunc(void)
{
wchar_t* argv[] = {PROGRAM_NAME, L"-c", L"import embedded_ext; print(embedded_ext)"};
wchar_t* argv[] = {PROGRAM_NAME, L"-c", L"import my_test_extension; print(my_test_extension)"};
PyConfig config;
if (PyImport_AppendInittab("create_static_module",
&PyInit_create_static_module) != 0) {
Expand All @@ -2256,7 +2256,7 @@ static int test_create_module_from_initfunc(void)
" _ORIGIN = \"static-extension\"\n"
" @classmethod\n"
" def find_spec(cls, fullname, path, target=None):\n"
" if fullname == \"embedded_ext\":\n"
" if fullname == \"my_test_extension\":\n"
" return spec_from_loader(fullname, cls, origin=cls._ORIGIN)\n"
" return None\n"
" @staticmethod\n"
Expand Down
1 change: 0 additions & 1 deletion Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -2365,7 +2365,6 @@ is_builtin(PyObject *name)
static PyModInitFunction
lookup_inittab_initfunc(const struct _Py_ext_module_loader_info* info)
{
struct _inittab *found = NULL;
for (struct _inittab *p = INITTAB; p->name != NULL; p++) {
if (_PyUnicode_EqualToASCIIString(info->name, p->name)) {
return (PyModInitFunction)p->initfunc;
Expand Down
Loading