Description: Python 3.1x patch
 Proper detection of platlib for Python3 >= 3.10
Author: Steffen Grunewald <steffen.grunewald@ligo.org>
Last-Update: 2024-01-10

--- framel-8.46.1.orig/Python/CMakeLists.txt
+++ framel-8.46.1/Python/CMakeLists.txt
@@ -55,7 +55,13 @@ if (ENABLE_PYTHON)
         #If not writeable then create a python lib directory from the CMAKE_INSTALL_PREFIX
         execute_process(
             COMMAND "${Python3_EXECUTABLE}" "-c"
-            "import sysconfig; print(sysconfig.get_path('platlib', vars={'base': '.', 'platbase': '.', 'platlibdir': 'lib'}))"
+            "import sysconfig
+try:
+  sitedir = sysconfig.get_path('platlib', 'deb_system', vars={'base': '.', 'platbase': '.', 'platlibdir': 'lib'})
+except KeyError:
+  sitedir = sysconfig.get_path('platlib', vars={'base': '.', 'platbase': '.', 'platlibdir': 'lib'})
+print(sitedir)"
+#            "import sysconfig; print(sysconfig.get_path('platlib', 'deb_system', vars={'base': '.', 'platbase': '.', 'platlibdir': 'lib'}))"
             RESULT_VARIABLE _Python3_RESULT
             OUTPUT_VARIABLE Python3_INSTALL_DIR
             OUTPUT_STRIP_TRAILING_WHITESPACE
