diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-27 14:57:39 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-27 14:57:39 +0200 |
commit | 88983fee9e51b919e0435b26f4df826ed7652bd0 (patch) | |
tree | 49a77bdba73773e58c163b91ee15a762625362dc /Include/import.h | |
parent | 90c0cf9f007388b4ef8137b83ec4a7b9addad426 (diff) | |
download | cpython-88983fee9e51b919e0435b26f4df826ed7652bd0.tar.gz |
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.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Include/import.h b/Include/import.h index 46c0d8e8e7..bb6beba67b 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 */ ); |