File onnxruntime-exact-python-version.patch of Package onnxruntime

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 5555fa69..4e1a9c2b 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -576,16 +576,16 @@ endif()
 if (onnxruntime_BUILD_SHARED_LIB OR onnxruntime_ENABLE_PYTHON)
   if (onnxruntime_ENABLE_PYTHON)
     if (onnxruntime_REQUIRE_PYTHON_EMBED_LIB)
-      find_package(Python 3.8 COMPONENTS Interpreter Development NumPy)
+      find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development NumPy)
     else()
-      find_package(Python 3.8 COMPONENTS Interpreter Development.Module NumPy)
+      find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development.Module NumPy)
     endif()
     message("Numpy version: ${Python_NumPy_VERSION}")
     if(Python_NumPy_VERSION VERSION_LESS "2.0.0")
       message(WARNING "The build binary will not be compatible with NumPy 2.0 because the NumPy installed on this machine is too low.")
     endif()
   else()
-    find_package(Python 3.8 COMPONENTS Interpreter)
+    find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter)
   endif()
 endif()
 
openSUSE Build Service is sponsored by