[gobject-introspection] scanner: Remove leading $SHELL in libtool call



commit 9216e612f0e9797d4f2dd84a97b890c3069b69c0
Author: Nicola Fontana <ntd entidi it>
Date:   Tue Feb 16 16:18:03 2016 -0500

    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

 giscanner/ccompiler.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/ccompiler.py b/giscanner/ccompiler.py
index 9b27f0e..021345e 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]