summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Fontana <ntd@entidi.it>2016-02-16 16:18:03 -0500
committerColin Walters <walters@verbum.org>2016-02-16 16:18:03 -0500
commit9216e612f0e9797d4f2dd84a97b890c3069b69c0 (patch)
treeffce7941cd0b5fb491efc47fd69aed565a55fda6
parentb638438e874fa437adff3bb0480710fe5cbe120c (diff)
downloadgobject-introspection-9216e612f0e9797d4f2dd84a97b890c3069b69c0.tar.gz
scanner: Remove leading $SHELL in libtool call
Avoid crashes due to double shell in subprocess.Popen() on linux, e.g.: ``` >>> import subprocess >>> subprocess.Popen(['/bin/sh', '/bin/sh']) /bin/sh: /bin/sh: cannot execute binary file ``` https://bugzilla.gnome.org/show_bug.cgi?id=761982
-rw-r--r--giscanner/ccompiler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 9b27f0e1..021345ee 100644
--- a/giscanner/ccompiler.py
+++ b/giscanner/ccompiler.py
@@ -277,7 +277,8 @@ class CCompiler(object):
else:
libtool = utils.get_libtool_command(options)
if libtool:
- args.append(utils.which(os.environ.get('SHELL', 'sh.exe')))
+ if os.name == 'nt':
+ args.append(utils.which(os.environ.get('SHELL', 'sh.exe')))
args.extend(libtool)
args.append('--mode=execute')
# FIXME: it could have prefix (i686-w64-mingw32-dlltool.exe)