aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/libshiboken/sbkfeature_base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken6/libshiboken/sbkfeature_base.cpp')
-rw-r--r--sources/shiboken6/libshiboken/sbkfeature_base.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sources/shiboken6/libshiboken/sbkfeature_base.cpp b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
index 63b5d9e57..d732faa29 100644
--- a/sources/shiboken6/libshiboken/sbkfeature_base.cpp
+++ b/sources/shiboken6/libshiboken/sbkfeature_base.cpp
@@ -178,7 +178,12 @@ void initEnumFlagsDict(PyTypeObject *type)
static PyObject *replaceNoArgWithZero(PyObject *callable)
{
- static auto *functools = PyImport_ImportModule("_functools"); // builtin
+#ifdef PYPY_VERSION
+ const char *functools_str = "functools";
+#else
+ const char *functools_str = "_functools";
+#endif
+ static auto *functools = PyImport_ImportModule(functools_str); // builtin
static auto *partial = PyObject_GetAttrString(functools, "partial");
static auto *zero = PyLong_FromLong(0);
return PyObject_CallFunctionObjArgs(partial, callable, zero, nullptr);