Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04778a8

Browse files
committed
make PyImport_ImportModuleLevel's first arg const like similiar functions (closes #12173)
1 parent 8a02100 commit 04778a8

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

Include/import.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock(
4444
const char *name /* UTF-8 encoded string */
4545
);
4646
PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
47-
char *name, /* UTF-8 encoded string */
47+
const char *name, /* UTF-8 encoded string */
4848
PyObject *globals,
4949
PyObject *locals,
5050
PyObject *fromlist,

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,9 @@ C-API
826826
- PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with
827827
Mercurial.
828828

829+
- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const
830+
char *` instead of `char *1`.
831+
829832
Documentation
830833
-------------
831834

Python/import.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals,
28182818
}
28192819

28202820
PyObject *
2821-
PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals,
2821+
PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals,
28222822
PyObject *fromlist, int level)
28232823
{
28242824
PyObject *nameobj, *mod;

0 commit comments

Comments
 (0)