Author: Edd Barrett <vex...@gmail.com>
Branch: argparse-collect
Changeset: r244:a69a3358ced8
Date: 2013-09-05 13:22 +0100
http://bitbucket.org/pypy/jitviewer/changeset/a69a3358ced8/

Log:    Use the same pypy interpreter that jitviewer is run under when
        collecting logs.

        As suggested by Armin Rigo.

diff --git a/_jitviewer/app.py b/_jitviewer/app.py
--- a/_jitviewer/app.py
+++ b/_jitviewer/app.py
@@ -5,7 +5,7 @@
 EPILOG = """
 Typical usage with no existing log file:
 
-    jitviewer.py --collect pypy <your script> <arg1> ... <argn>
+    jitviewer.py --collect <your script> <arg1> ... <argn>
 
 Typical usage with existing log file:
 
@@ -214,7 +214,7 @@
     # possibly make this configurable if someone asks...
     os.environ["PYPYLOG"] = "jit-log-opt,jit-backend:%s" % (path, )
     print("Collecting log in '%s'..." % path)
-    p = subprocess.Popen(args, env=os.environ).communicate()
+    p = subprocess.Popen([sys.executable] + args, env=os.environ).communicate()
 
     # We don't check the return status. The user may want to see traces
     # for a failing program!
@@ -242,11 +242,11 @@
         args.port = 5000
 
     if args.collect is not None:
-        if len(args.collect) < 2:
+        if len(args.collect) < 1:
             print("*Error: Please correctly specify invokation to collect log")
             sys.exit(1)
         filename = collect_log(args.collect)
-        extra_path = os.path.dirname(args.collect[1]) # add dirname of script 
to extra_path
+        extra_path = os.path.dirname(args.collect[0]) # add dirname of script 
to extra_path
     elif args.log is not None:
         filename = args.log
         # preserving behaviour before argparse
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to