From: Benjamin Peterson Date: Wed, 25 May 2011 14:29:00 +0000 (-0500) Subject: make PyImport_ImportModuleLevel's first arg const like similiar functions (closes... X-Git-Tag: v3.3.0a1~2183^2~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04778a8150430edc2c441f2f86193ca690d60aa3;p=python make PyImport_ImportModuleLevel's first arg const like similiar functions (closes #12173) --- diff --git a/Include/import.h b/Include/import.h index 6331edf7ef..4554411156 100644 --- a/Include/import.h +++ b/Include/import.h @@ -44,7 +44,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleNoBlock( const char *name /* UTF-8 encoded string */ ); PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel( - char *name, /* UTF-8 encoded string */ + const char *name, /* UTF-8 encoded string */ PyObject *globals, PyObject *locals, PyObject *fromlist, diff --git a/Misc/NEWS b/Misc/NEWS index 6762731af6..36a3c9da18 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -826,6 +826,9 @@ C-API - PY_PATCHLEVEL_REVISION has been removed, since it's meaningless with Mercurial. +- Issue #12173: The first argument of PyImport_ImportModuleLevel is now `const + char *` instead of `char *1`. + Documentation ------------- diff --git a/Python/import.c b/Python/import.c index 5360d57c51..bfb976c77c 100644 --- a/Python/import.c +++ b/Python/import.c @@ -2818,7 +2818,7 @@ PyImport_ImportModuleLevelObject(PyObject *name, PyObject *globals, } PyObject * -PyImport_ImportModuleLevel(char *name, PyObject *globals, PyObject *locals, +PyImport_ImportModuleLevel(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist, int level) { PyObject *nameobj, *mod;