SHARE
TWEET

scons_win32_spawn_patch.diff

a guest Apr 22nd, 2013 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: scons/scons-local-1.2.0.d20090223/SCons/Platform/win32.py
  2. ===================================================================
  3. --- scons/scons-local-1.2.0.d20090223/SCons/Platform/win32.py   (Revision 56198)
  4. +++ scons/scons-local-1.2.0.d20090223/SCons/Platform/win32.py   (Arbeitskopie)
  5. @@ -173,10 +173,24 @@
  6.      return result
  7.  
  8.  def spawn(sh, escape, cmd, args, env):
  9. -    if not sh:
  10. -        sys.stderr.write("scons: Could not find command interpreter, is it in your PATH?\n")
  11. -        return 127
  12. -    return exec_spawn([sh, '/C', escape(string.join(args))], env)
  13. +    import subprocess
  14. +    newargs = " ".join(args[1:])
  15. +    cmdline = cmd + " " + newargs
  16. +    startupinfo = subprocess.STARTUPINFO()
  17. +    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
  18. +    proc = subprocess.Popen(cmdline,
  19. +                            stdin = subprocess.PIPE,
  20. +                            stdout = subprocess.PIPE,
  21. +                            stderr = subprocess.PIPE,
  22. +                            startupinfo = startupinfo,
  23. +                            shell = False, env = env)
  24. +    data, err = proc.communicate()
  25. +    rv = proc.wait()
  26. +    if rv:
  27. +        print "====="
  28. +        print err
  29. +        print "====="
  30. +    return rv
  31.  
  32.  # Windows does not allow special characters in file names anyway, so no
  33.  # need for a complex escape function, we will just quote the arg, except
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top