fix: python: monkey patch the proper sysconfig implementation
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 8 Mar 2023 16:06:37 +0000 (11:06 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 10 Mar 2023 16:40:14 +0000 (11:40 -0500)
Since we monkey patch sysconfig, use the distutils implementation when
building with distutils and the upstream one when building with
setuptools.

This ensures the properly patched version is used to build the
extension.

Change-Id: I66eb2d02519d585a15721b2bd77007672e895d7a
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/9621
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bindings/python/bt2/setup.py.in

index fff970870f83f705a4a4ae54e6aee959d060b612..9b4294c7e0c9712cea32350342f14fa4744b44eb 100644 (file)
@@ -5,12 +5,13 @@
 
 import sys
 import os
-import sysconfig
 
 if sys.version_info < (3, 12):
     from distutils.core import setup, Extension
+    import distutils.sysconfig as sysconfig
 else:
     from setuptools import setup, Extension
+    import sysconfig
 
 PY_PATH_WARN_MSG = """
 -------------------------------------WARNING------------------------------------
This page took 0.027147 seconds and 4 git commands to generate.