Author: mattip <matti.pi...@gmail.com>
Branch: 
Changeset: r72024:eed854395434
Date: 2014-06-11 21:56 +0300
http://bitbucket.org/pypy/pypy/changeset/eed854395434/

Log:    check and raise when shell = True

diff --git a/rpython/tool/runsubprocess.py b/rpython/tool/runsubprocess.py
--- a/rpython/tool/runsubprocess.py
+++ b/rpython/tool/runsubprocess.py
@@ -35,6 +35,10 @@
 
     pipe = Popen(args, stdout=PIPE, stderr=PIPE, shell=shell, env=env, cwd=cwd)
     stdout, stderr = pipe.communicate()
+    if (sys.platform == 'win32' and pipe.returncode == 1 and 
+        'is not recognized' in stderr):
+        # Setting shell=True on windows messes up expected exceptions
+        raise EnvironmentError(stderr)
     return pipe.returncode, stdout, stderr
 
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to