From 02648ce49748032a78937c8cdb8c015577b9ff2a Mon Sep 17 00:00:00 2001 From: Zhanwen Chen Date: Fri, 14 Jun 2024 16:55:51 -0700 Subject: [PATCH] Fix Python Source RelPath for PY_LIMITED_API=OFF --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fd4181d0..4f50b3e3 100644 --- a/setup.py +++ b/setup.py @@ -118,8 +118,11 @@ def main(): # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. + # If not specifying PY_LIMITED_API, the Python sources go under python/cv2/python-3.MINOR_VERSION/ instead of python/cv2/python-3/ [ - r"python/cv2/python-%s/cv2.*" + r"python/cv2/python-%s*/cv2.*" + % (sys.version_info[0]) if 'CMAKE_ARGS' in os.environ and "-DPYTHON3_LIMITED_API=ON" in os.environ['CMAKE_ARGS'] + else r"python/cv2/python-%s.*/cv2.*" % (sys.version_info[0]) ] +