Skip to content

Commit 35e9e78

Browse files
committed
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)
1 parent 7af34eb commit 35e9e78

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

Lib/test/test_embed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def test_repeated_init_and_inittab(self):
242242
def test_create_module_from_initfunc(self):
243243
out, err = self.run_embedded_interpreter("test_create_module_from_initfunc")
244244
self.assertEqual(err, "")
245-
self.assertEqual(out, "<module 'embedded_ext' (static-extension)>\n")
245+
self.assertEqual(out, "<module 'my_test_extension' (static-extension)>\n")
246246

247247
def test_forced_io_encoding(self):
248248
# Checks forced configuration of embedded interpreter IO streams

Programs/_testembed.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ static int test_repeated_init_and_inittab(void)
22142214
}
22152215

22162216
static PyObject* create_module(PyObject* self, PyObject* spec) {
2217-
return PyImport_CreateModuleFromInitfunc(spec, PyInit_embedded_ext);
2217+
return PyImport_CreateModuleFromInitfunc(spec, init_my_test_extension);
22182218
}
22192219

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

22372237
static int test_create_module_from_initfunc(void)
22382238
{
2239-
wchar_t* argv[] = {PROGRAM_NAME, L"-c", L"import embedded_ext; print(embedded_ext)"};
2239+
wchar_t* argv[] = {PROGRAM_NAME, L"-c", L"import my_test_extension; print(my_test_extension)"};
22402240
PyConfig config;
22412241
if (PyImport_AppendInittab("create_static_module",
22422242
&PyInit_create_static_module) != 0) {
@@ -2256,7 +2256,7 @@ static int test_create_module_from_initfunc(void)
22562256
" _ORIGIN = \"static-extension\"\n"
22572257
" @classmethod\n"
22582258
" def find_spec(cls, fullname, path, target=None):\n"
2259-
" if fullname == \"embedded_ext\":\n"
2259+
" if fullname == \"my_test_extension\":\n"
22602260
" return spec_from_loader(fullname, cls, origin=cls._ORIGIN)\n"
22612261
" return None\n"
22622262
" @staticmethod\n"

Python/import.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2365,7 +2365,6 @@ is_builtin(PyObject *name)
23652365
static PyModInitFunction
23662366
lookup_inittab_initfunc(const struct _Py_ext_module_loader_info* info)
23672367
{
2368-
struct _inittab *found = NULL;
23692368
for (struct _inittab *p = INITTAB; p->name != NULL; p++) {
23702369
if (_PyUnicode_EqualToASCIIString(info->name, p->name)) {
23712370
return (PyModInitFunction)p->initfunc;

0 commit comments

Comments
 (0)