[gobject-introspection] g-ir-tool: ask sysconfig instead of hardcoding the extension module suffix
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] g-ir-tool: ask sysconfig instead of hardcoding the extension module suffix
- Date: Tue, 21 Aug 2018 10:49:01 +0000 (UTC)
commit 5d5ce7f93e5032776f6e40352bfe74c904ad1d99
Author: Christoph Reiter <reiter christoph gmail com>
Date: Tue Aug 21 12:17:04 2018 +0200
g-ir-tool: ask sysconfig instead of hardcoding the extension module suffix
MinGW Python doesn't use .pyd so this makes sure we always look for the
file distutils produces for the given Python setup.
tools/g-ir-tool-template.in | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/tools/g-ir-tool-template.in b/tools/g-ir-tool-template.in
index fb6b665b..ed33d16b 100755
--- a/tools/g-ir-tool-template.in
+++ b/tools/g-ir-tool-template.in
@@ -25,6 +25,7 @@ from __future__ import unicode_literals
import os
import sys
+import sysconfig
if sys.version_info.major < 3:
import __builtin__ as builtins
@@ -62,11 +63,10 @@ builtins.__dict__['DATADIR'] = datadir
# Again, relative paths first so that the installation prefix is relocatable
pylibdir = os.path.abspath(os.path.join(filedir, '..', 'lib', 'gobject-introspection'))
-py_mod_suffix = 'so'
-if os.name == 'nt':
- py_mod_suffix = 'pyd'
+# EXT_SUFFIX for py3 SO for py2
+py_mod_suffix = sysconfig.get_config_var('EXT_SUFFIX') or sysconfig.get_config_var('SO')
-if not os.path.isfile(os.path.join(pylibdir, 'giscanner', '_giscanner.' + py_mod_suffix)):
+if not os.path.isfile(os.path.join(pylibdir, 'giscanner', '_giscanner' + py_mod_suffix)):
# Running uninstalled?
builddir = os.getenv('UNINSTALLED_INTROSPECTION_BUILDDIR', None)
if builddir is not None:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]