diff options
author | Christian Tismer <tismer@stackless.com> | 2020-04-27 13:51:53 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-05-22 12:53:29 +0000 |
commit | 15e470d1af2274579bd0709fc56e6788f44874d2 (patch) | |
tree | a5043cf2be17976ed830dbc17513c6631c99cab8 | |
parent | 8e22b0d5b52f615a9b8ed4d278d103df9f2bd71c (diff) |
Fix the no longer tested Py_LIMITED_API
The limited API has always been tested in COIN.
Not so last time when I checked this.
I had a check-in which defined PyImport_GetModule for Python
versions < 3.7, but did not see that this function does not
exist when the Py_LIMITED_API is defined.
The check-in should therefore have been broken, but it went
through. That means that the Py_LIMITED_API is not tested,
at least since commit c82ec2bc on 2020-05-18.
Should we change the default, and how?
Change-Id: I69ffaa1edeba9d7408c67f2cface8c4113ffcbe9
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken2/libshiboken/pep384impl.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken2/libshiboken/pep384impl.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp index 6405d777a..f07cac613 100644 --- a/sources/shiboken2/libshiboken/pep384impl.cpp +++ b/sources/shiboken2/libshiboken/pep384impl.cpp @@ -641,7 +641,7 @@ PepType_GetNameStr(PyTypeObject *type) * Newly introduced convenience functions * */ -#if PY_VERSION_HEX < 0x03070000 +#if PY_VERSION_HEX < 0x03070000 || defined(Py_LIMITED_API) PyObject * PyImport_GetModule(PyObject *name) @@ -667,7 +667,7 @@ PyImport_GetModule(PyObject *name) return m; } -#endif // PY_VERSION_HEX < 0x03070000 +#endif // PY_VERSION_HEX < 0x03070000 || defined(Py_LIMITED_API) /***************************************************************************** * * Extra support for name mangling diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h index c180a06c1..541b0e775 100644 --- a/sources/shiboken2/libshiboken/pep384impl.h +++ b/sources/shiboken2/libshiboken/pep384impl.h @@ -525,10 +525,11 @@ extern LIBSHIBOKEN_API PyTypeObject *PepMethodDescr_TypePtr; * * Newly introduced convenience functions * + * This is not defined if Py_LIMITED_API is defined. */ -#if PY_VERSION_HEX < 0x03070000 +#if PY_VERSION_HEX < 0x03070000 || defined(Py_LIMITED_API) LIBSHIBOKEN_API PyObject *PyImport_GetModule(PyObject *name); -#endif // PY_VERSION_HEX < 0x03070000 +#endif // PY_VERSION_HEX < 0x03070000 || defined(Py_LIMITED_API) /***************************************************************************** * |