[pypy-svn] r40777 - in pypy/dist/pypy/translator: . tool

arigo at codespeak.net arigo at codespeak.net
Mon Mar 19 16:22:17 CET 2007


Author: arigo
Date: Mon Mar 19 16:22:16 2007
New Revision: 40777

Modified:
   pypy/dist/pypy/translator/driver.py
   pypy/dist/pypy/translator/tool/cbuild.py
Log:
Use the shell to expand a single string into multiple arguments.
This fixes a bug causing profopt pypy translations to not do any
profiling at all.


Modified: pypy/dist/pypy/translator/driver.py
==============================================================================
--- pypy/dist/pypy/translator/driver.py	(original)
+++ pypy/dist/pypy/translator/driver.py	Mon Mar 19 16:22:16 2007
@@ -69,7 +69,7 @@
         from py.compat import subprocess
         env = os.environ.copy()
         env['_INSTRUMENT_COUNTERS'] = str(self.datafile)
-        subprocess.call([exe, args], env=env)
+        subprocess.call("'%s' %s" % (exe, args), env=env, shell=True)
         
     def after(self):
         # xxx

Modified: pypy/dist/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/dist/pypy/translator/tool/cbuild.py	(original)
+++ pypy/dist/pypy/translator/tool/cbuild.py	Mon Mar 19 16:22:16 2007
@@ -270,9 +270,10 @@
         self.build('-fprofile-generate')
 
     def probe(self, exe, args):
-        from py.compat import subprocess
-        subprocess.call([exe, args])
-        
+        # 'args' is a single string typically containing spaces
+        # and quotes, which represents several arguments.
+        os.system("'%s' %s" % (exe, args))
+
     def after(self):
         self.build('-fprofile-use')
 



More information about the Pypy-commit mailing list