Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CYTHON_LIMITED_API: Fix import utility code #5549

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 0 additions & 10 deletions Cython/Utility/ImportExport.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
// Avoid C compiler warning if strchr() evaluates to false at compile time.
if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
/* try package relative import first */
#if CYTHON_COMPILING_IN_LIMITED_API
module = PyImport_ImportModuleLevelObject(
name, empty_dict, empty_dict, from_list, 1);
#else
module = PyImport_ImportModuleLevelObject(
name, $moddict_cname, empty_dict, from_list, 1);
#endif
if (unlikely(!module)) {
if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
goto bad;
Expand All @@ -244,14 +239,9 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
name, $moddict_cname, empty_dict, from_list, py_level, (PyObject *)NULL);
Py_DECREF(py_level);
#else
#if CYTHON_COMPILING_IN_LIMITED_API
module = PyImport_ImportModuleLevelObject(
name, empty_dict, empty_dict, from_list, level);
#else
module = PyImport_ImportModuleLevelObject(
name, $moddict_cname, empty_dict, from_list, level);
#endif
#endif
}
}
bad:
Expand Down