Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f07f32f

Browse filesBrowse files
Drop _PyImport_FixupExtensionObject().
1 parent 315d25d commit f07f32f
Copy full SHA for f07f32f

File tree

Expand file treeCollapse file tree

3 files changed

+2
-46
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+2
-46
lines changed

‎Include/internal/pycore_import.h

Copy file name to clipboardExpand all lines: Include/internal/pycore_import.h
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ extern int _PyImport_FixupBuiltin(
2929
const char *name, /* UTF-8 encoded string */
3030
PyObject *modules
3131
);
32-
// We could probably drop this:
33-
extern int _PyImport_FixupExtensionObject(PyObject*, PyObject *,
34-
PyObject *, PyObject *);
3532

3633
// Export for many shared extensions, like '_json'
3734
PyAPI_FUNC(PyObject*) _PyImport_GetModuleAttr(PyObject *, PyObject *);
@@ -55,7 +52,7 @@ struct _import_runtime_state {
5552
Only legacy (single-phase init) extension modules are added
5653
and only if they support multiple initialization (m_size >- 0)
5754
or are imported in the main interpreter.
58-
This is initialized lazily in _PyImport_FixupExtensionObject().
55+
This is initialized lazily in fix_up_extension() in import.c.
5956
Modules are added there and looked up in _imp.find_extension(). */
6057
_Py_hashtable_t *hashtable;
6158
} extensions;

‎Include/moduleobject.h

Copy file name to clipboardExpand all lines: Include/moduleobject.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ typedef struct PyModuleDef_Base {
5353
/* A copy of the module's __dict__ after the first time it was loaded.
5454
This is only set/used for legacy modules that do not support
5555
multiple initializations.
56-
It is set by _PyImport_FixupExtensionObject(). */
56+
It is set by fix_up_extension() in import.c. */
5757
PyObject* m_copy;
5858
} PyModuleDef_Base;
5959

‎Python/import.c

Copy file name to clipboardExpand all lines: Python/import.c
-41Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,47 +1285,6 @@ finish_singlephase_extension(PyThreadState *tstate,
12851285
return 0;
12861286
}
12871287

1288-
int
1289-
_PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
1290-
PyObject *filename, PyObject *modules)
1291-
{
1292-
PyThreadState *tstate = _PyThreadState_GET();
1293-
1294-
if (mod == NULL || !PyModule_Check(mod)) {
1295-
PyErr_BadInternalCall();
1296-
return -1;
1297-
}
1298-
PyModuleDef *def = PyModule_GetDef(mod);
1299-
if (def == NULL) {
1300-
PyErr_BadInternalCall();
1301-
return -1;
1302-
}
1303-
1304-
/* Only single-phase init extension modules can reach here. */
1305-
assert(is_singlephase(def));
1306-
assert(!is_core_module(tstate->interp, name, filename));
1307-
assert(!is_core_module(tstate->interp, name, name));
1308-
1309-
struct singlephase_global_update singlephase = {0};
1310-
// gh-88216: Extensions and def->m_base.m_copy can be updated
1311-
// when the extension module doesn't support sub-interpreters.
1312-
if (def->m_size == -1) {
1313-
singlephase.m_dict = PyModule_GetDict(mod);
1314-
assert(singlephase.m_dict != NULL);
1315-
}
1316-
if (update_global_state_for_extension(
1317-
tstate, filename, name, def, &singlephase) < 0)
1318-
{
1319-
return -1;
1320-
}
1321-
1322-
if (finish_singlephase_extension(tstate, mod, def, name, modules) < 0) {
1323-
return -1;
1324-
}
1325-
1326-
return 0;
1327-
}
1328-
13291288

13301289
static PyObject *
13311290
import_find_extension(PyThreadState *tstate,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.