From 89ed813585ac6ecbe57351f3e4892730e42b6e02 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Fri, 25 Sep 2020 14:16:46 +0300 Subject: [PATCH] python: fixed limited API build --- modules/python/python3/CMakeLists.txt | 1 + modules/python/src2/cv2.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/python/python3/CMakeLists.txt b/modules/python/python3/CMakeLists.txt index ae1f989d3a..d95af21e04 100644 --- a/modules/python/python3/CMakeLists.txt +++ b/modules/python/python3/CMakeLists.txt @@ -7,6 +7,7 @@ if(PYTHON3_LIMITED_API AND NOT PYTHON3_NUMPY_VERSION VERSION_LESS "1.15" AND PYTHON3_NUMPY_VERSION VERSION_LESS "1.17" ) + message(WARNING "Current NUMPY version (${PYTHON3_NUMPY_VERSION}) is not compatible with LIMITED_API.") set(PYTHON3_LIMITED_API OFF) endif() diff --git a/modules/python/src2/cv2.cpp b/modules/python/src2/cv2.cpp index da771f6778..f949a340e4 100644 --- a/modules/python/src2/cv2.cpp +++ b/modules/python/src2/cv2.cpp @@ -1499,7 +1499,7 @@ convert_to_python_tuple(const std::tuple& cpp_tuple, PyObject* py_tuple) if (!item) return; - PyTuple_SET_ITEM(py_tuple, I, item); + PyTuple_SetItem(py_tuple, I, item); convert_to_python_tuple(cpp_tuple, py_tuple); }