Skip to content

rename _imp initialization function to follow conventions #5432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Include/import.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {
#ifndef Py_LIMITED_API
PyAPI_FUNC(_PyInitError) _PyImportZip_Init(void);

PyMODINIT_FUNC PyInit_imp(void);
PyMODINIT_FUNC PyInit__imp(void);
#endif /* !Py_LIMITED_API */
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
Expand Down
4 changes: 2 additions & 2 deletions Modules/config.c.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extern "C" {
/* -- ADDMODULE MARKER 1 -- */

extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit_imp(void);
extern PyObject* PyInit__imp(void);
extern PyObject* PyInit_gc(void);
extern PyObject* PyInit__ast(void);
extern PyObject* _PyWarnings_Init(void);
Expand All @@ -39,7 +39,7 @@ struct _inittab _PyImport_Inittab[] = {
{"marshal", PyMarshal_Init},

/* This lives in import.c */
{"_imp", PyInit_imp},
{"_imp", PyInit__imp},

/* This lives in Python/Python-ast.c */
{"_ast", PyInit__ast},
Expand Down
4 changes: 2 additions & 2 deletions PC/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extern PyObject* PyInit__opcode(void);
/* -- ADDMODULE MARKER 1 -- */

extern PyObject* PyMarshal_Init(void);
extern PyObject* PyInit_imp(void);
extern PyObject* PyInit__imp(void);

struct _inittab _PyImport_Inittab[] = {

Expand Down Expand Up @@ -147,7 +147,7 @@ struct _inittab _PyImport_Inittab[] = {
{"marshal", PyMarshal_Init},

/* This lives it with import.c */
{"_imp", PyInit_imp},
{"_imp", PyInit__imp},

/* These entries are here for sys.builtin_module_names */
{"builtins", NULL},
Expand Down
3 changes: 1 addition & 2 deletions Python/import.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* Module definition and import implementation */

#include "Python.h"
Expand Down Expand Up @@ -2253,7 +2252,7 @@ static struct PyModuleDef impmodule = {
const char *_Py_CheckHashBasedPycsMode = "default";

PyMODINIT_FUNC
PyInit_imp(void)
PyInit__imp(void)
{
PyObject *m, *d;

Expand Down
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ initimport(PyInterpreterState *interp, PyObject *sysmod)
Py_INCREF(interp->import_func);

/* Import the _imp module */
impmod = PyInit_imp();
impmod = PyInit__imp();
if (impmod == NULL) {
return _Py_INIT_ERR("can't import _imp");
}
Expand Down