From 018288e258d46bc36973e1743b9cdf6dae48af65 Mon Sep 17 00:00:00 2001 From: Severin Strobl Date: Thu, 13 Jan 2022 19:11:54 +0100 Subject: [PATCH] Python sysconfig variable 'SO' is deprecated The new variable 'EXT_SUFFIX' was introduced with Python 3 with the old 'SO' variable scheduled for deprecation in Python 3.4. The actual deprecation warning apparently was introduced in Python 3.7. --- waflib/Tools/python.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/waflib/Tools/python.py b/waflib/Tools/python.py index fb641e5e..46f3a8c9 100644 --- a/waflib/Tools/python.py +++ b/waflib/Tools/python.py @@ -315,7 +315,8 @@ def check_python_headers(conf, features='pyembed pyext'): conf.fatal('Could not find the python executable') # so we actually do all this for compatibility reasons and for obtaining pyext_PATTERN below - v = 'prefix SO LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() + v = 'prefix LDFLAGS LIBDIR LIBPL INCLUDEPY Py_ENABLE_SHARED MACOSX_DEPLOYMENT_TARGET LDSHARED CFLAGS LDVERSION'.split() + v.append('SO' if sys.hexversion < 0x03070000 else 'EXT_SUFFIX') try: lst = conf.get_python_variables(["get_config_var('%s') or ''" % x for x in v]) except RuntimeError: @@ -328,7 +329,7 @@ def check_python_headers(conf, features='pyembed pyext'): x = 'MACOSX_DEPLOYMENT_TARGET' if dct[x]: env[x] = conf.environ[x] = str(dct[x]) - env.pyext_PATTERN = '%s' + dct['SO'] # not a mistake + env.pyext_PATTERN = '%s' + dct['SO' if sys.hexversion < 0x03070000 else 'EXT_SUFFIX'] # not a mistake # Try to get pythonX.Y-config @@ -646,4 +647,3 @@ def options(opt): help='Installation path for python modules (py, platform-independent .py and .pyc files)') pyopt.add_option('--pythonarchdir', dest='pythonarchdir', help='Installation path for python extension (pyext, platform-dependent .so or .dylib files)') -