summaryrefslogtreecommitdiffstats
path: root/Include/import.h
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-12-27 12:57:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-12-27 12:57:39 (GMT)
commit34d0ac8027e23609e24588735b37b8d5a55f7223 (patch)
tree84a0cf6da6af786f863784b6a6a773a30fb8f4e0 /Include/import.h
parent5d1111e87ecf28c6b962f869f05b5f7bcde2028b (diff)
downloadcpython-34d0ac8027e23609e24588735b37b8d5a55f7223.zip
cpython-34d0ac8027e23609e24588735b37b8d5a55f7223.tar.gz
cpython-34d0ac8027e23609e24588735b37b8d5a55f7223.tar.bz2
Issue #29058: All stable API extensions added after Python 3.2 are now
available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of the minimum Python version supporting this API.
Diffstat (limited to 'Include/import.h')
-rw-r--r--Include/import.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/Include/import.h b/Include/import.h
index 46c0d8e..bb6beba6 100644
--- a/Include/import.h
+++ b/Include/import.h
@@ -9,9 +9,9 @@ extern "C" {
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyImportZip_Init(void);
-#endif /* !Py_LIMITED_API */
PyMODINIT_FUNC PyInit_imp(void);
+#endif /* !Py_LIMITED_API */
PyAPI_FUNC(long) PyImport_GetMagicNumber(void);
PyAPI_FUNC(const char *) PyImport_GetMagicTag(void);
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModule(
@@ -29,16 +29,20 @@ PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleWithPathnames(
const char *pathname, /* decoded from the filesystem encoding */
const char *cpathname /* decoded from the filesystem encoding */
);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(PyObject *) PyImport_ExecCodeModuleObject(
PyObject *name,
PyObject *co,
PyObject *pathname,
PyObject *cpathname
);
+#endif
PyAPI_FUNC(PyObject *) PyImport_GetModuleDict(void);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(PyObject *) PyImport_AddModuleObject(
PyObject *name
);
+#endif
PyAPI_FUNC(PyObject *) PyImport_AddModule(
const char *name /* UTF-8 encoded string */
);
@@ -55,6 +59,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevel(
PyObject *fromlist,
int level
);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
PyObject *name,
PyObject *globals,
@@ -62,6 +67,7 @@ PyAPI_FUNC(PyObject *) PyImport_ImportModuleLevelObject(
PyObject *fromlist,
int level
);
+#endif
#define PyImport_ImportModuleEx(n, g, l, f) \
PyImport_ImportModuleLevel(n, g, l, f, 0)
@@ -70,9 +76,11 @@ PyAPI_FUNC(PyObject *) PyImport_GetImporter(PyObject *path);
PyAPI_FUNC(PyObject *) PyImport_Import(PyObject *name);
PyAPI_FUNC(PyObject *) PyImport_ReloadModule(PyObject *m);
PyAPI_FUNC(void) PyImport_Cleanup(void);
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
PyAPI_FUNC(int) PyImport_ImportFrozenModuleObject(
PyObject *name
);
+#endif
PyAPI_FUNC(int) PyImport_ImportFrozenModule(
const char *name /* UTF-8 encoded string */
);