Skip to content

Commit 7f9e7cd

Browse files
authored
Merge branch 'main' into gh-156443-longobject
2 parents d63c21e + c8da735 commit 7f9e7cd

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix the link of ``Programs/_freeze_module`` when extension modules are built
2+
in (``MODULE_BUILDTYPE=static``) and the test modules are enabled:
3+
``Modules/getpath_noop.c`` now defines ``_Py_Get_Getpath_CodeObject()``,
4+
which ``_testinternalcapi`` uses.

Modules/getpath_noop.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
/* Implements the getpath API for compiling with no functionality */
22

33
#include "Python.h"
4-
#include "pycore_pathconfig.h"
4+
#include "pycore_initconfig.h" // _Py_Get_Getpath_CodeObject()
5+
#include "pycore_pathconfig.h" // _PyConfig_InitPathConfig()
56

67
PyStatus
78
_PyConfig_InitPathConfig(PyConfig *config, int compute_path_config)
89
{
910
return PyStatus_Error("path configuration is unsupported");
1011
}
12+
13+
/* Used by _testinternalcapi, which is linked into Programs/_freeze_module
14+
when extension modules are built in (MODULE_BUILDTYPE=static). */
15+
PyObject *
16+
_Py_Get_Getpath_CodeObject(void)
17+
{
18+
PyErr_SetString(PyExc_RuntimeError,
19+
"path configuration is unsupported");
20+
return NULL;
21+
}

0 commit comments

Comments
 (0)