Skip to content

Commit

Permalink
CYTHON_LIMITED_API Fix import utility code (#5549)
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Jul 20, 2023
1 parent c7b21a0 commit 0ad32ea
Showing 1 changed file with 0 additions and 10 deletions.
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

0 comments on commit 0ad32ea

Please sign in to comment.