Unverified Kaydet (Commit) c65ef772 authored tarafından Benjamin Peterson's avatar Benjamin Peterson Kaydeden (comit) GitHub

rename _imp initialization function to follow conventions (#5432)

When the C imp module became _imp in 6f44d66b, the initialization function should have been renamed from PyInit_imp to PyInit__imp.
üst 2a2270db
...@@ -10,7 +10,7 @@ extern "C" { ...@@ -10,7 +10,7 @@ extern "C" {
#ifndef Py_LIMITED_API #ifndef Py_LIMITED_API
PyAPI_FUNC(_PyInitError) _PyImportZip_Init(void); PyAPI_FUNC(_PyInitError) _PyImportZip_Init(void);
PyMODINIT_FUNC PyInit_imp(void); PyMODINIT_FUNC PyInit__imp(void);
#endif /* !Py_LIMITED_API */ #endif /* !Py_LIMITED_API */
PyAPI_FUNC(long) PyImport_GetMagicNumber(void); PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void); PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
......
...@@ -25,7 +25,7 @@ extern "C" { ...@@ -25,7 +25,7 @@ extern "C" {
/* -- ADDMODULE MARKER 1 -- */ /* -- ADDMODULE MARKER 1 -- */
extern PyObject* PyMarshal_Init(void); extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit_imp(void); extern PyObject* PyInit__imp(void);
extern PyObject* PyInit_gc(void); extern PyObject* PyInit_gc(void);
extern PyObject* PyInit__ast(void); extern PyObject* PyInit__ast(void);
extern PyObject* _PyWarnings_Init(void); extern PyObject* _PyWarnings_Init(void);
...@@ -39,7 +39,7 @@ struct _inittab _PyImport_Inittab[] = { ...@@ -39,7 +39,7 @@ struct _inittab _PyImport_Inittab[] = {
{"marshal", PyMarshal_Init}, {"marshal", PyMarshal_Init},
/* This lives in import.c */ /* This lives in import.c */
{"_imp", PyInit_imp}, {"_imp", PyInit__imp},
/* This lives in Python/Python-ast.c */ /* This lives in Python/Python-ast.c */
{"_ast", PyInit__ast}, {"_ast", PyInit__ast},
......
...@@ -74,7 +74,7 @@ extern PyObject* PyInit__opcode(void); ...@@ -74,7 +74,7 @@ extern PyObject* PyInit__opcode(void);
/* -- ADDMODULE MARKER 1 -- */ /* -- ADDMODULE MARKER 1 -- */
extern PyObject* PyMarshal_Init(void); extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit_imp(void); extern PyObject* PyInit__imp(void);
struct _inittab _PyImport_Inittab[] = { struct _inittab _PyImport_Inittab[] = {
...@@ -147,7 +147,7 @@ struct _inittab _PyImport_Inittab[] = { ...@@ -147,7 +147,7 @@ struct _inittab _PyImport_Inittab[] = {
{"marshal", PyMarshal_Init}, {"marshal", PyMarshal_Init},
/* This lives it with import.c */ /* This lives it with import.c */
{"_imp", PyInit_imp}, {"_imp", PyInit__imp},
/* These entries are here for sys.builtin_module_names */ /* These entries are here for sys.builtin_module_names */
{"builtins", NULL}, {"builtins", NULL},
......
/* Module definition and import implementation */ /* Module definition and import implementation */
#include "Python.h" #include "Python.h"
...@@ -2253,7 +2252,7 @@ static struct PyModuleDef impmodule = { ...@@ -2253,7 +2252,7 @@ static struct PyModuleDef impmodule = {
const char *_Py_CheckHashBasedPycsMode = "default"; const char *_Py_CheckHashBasedPycsMode = "default";
PyMODINIT_FUNC PyMODINIT_FUNC
PyInit_imp(void) PyInit__imp(void)
{ {
PyObject *m, *d; PyObject *m, *d;
......
...@@ -312,7 +312,7 @@ initimport(PyInterpreterState *interp, PyObject *sysmod) ...@@ -312,7 +312,7 @@ initimport(PyInterpreterState *interp, PyObject *sysmod)
Py_INCREF(interp->import_func); Py_INCREF(interp->import_func);
/* Import the _imp module */ /* Import the _imp module */
impmod = PyInit_imp(); impmod = PyInit__imp();
if (impmod == NULL) { if (impmod == NULL) {
return _Py_INIT_ERR("can't import _imp"); return _Py_INIT_ERR("can't import _imp");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment