Commits

Victor Stinner  committed 44cc9ef

Issue #3080: Mark _PyImport_FindBuiltin() argument as constant

And as a consequence, mark also name argument of
_PyImport_FindExtensionUnicode() constant too. But I plan to change this
argument type to PyObject* later.

  • Participants
  • Parent commits ec3c067

Comments (0)

Files changed (2)

File Include/import.h

 PyAPI_FUNC(void) _PyImport_ReInitLock(void);
 
 PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin(
-    char *name                  /* UTF-8 encoded string */
+    const char *name            /* UTF-8 encoded string */
     );
-PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(char *, PyObject *);
+PyAPI_FUNC(PyObject *)_PyImport_FindExtensionUnicode(const char *, PyObject *);
 PyAPI_FUNC(int)_PyImport_FixupBuiltin(
     PyObject *mod,
     char *name                  /* UTF-8 encoded string */

File Python/import.c

 }
 
 PyObject *
-_PyImport_FindExtensionUnicode(char *name, PyObject *filename)
+_PyImport_FindExtensionUnicode(const char *name, PyObject *filename)
 {
     PyObject *mod, *mdict;
     PyModuleDef* def;
 }
 
 PyObject *
-_PyImport_FindBuiltin(char *name)
+_PyImport_FindBuiltin(const char *name)
 {
     PyObject *res, *filename;
     filename = PyUnicode_FromString(name);