Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mprof
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,15 @@ def run_action():
options.python = True
if options.python:
print("running as a Python program...")
if not args[0].startswith("python"):
args.insert(0, "python")
if not osp.basename(args[0]).startswith("python"):
if sys.executable:
args.insert(0, sys.executable)
else:
args.insert(0, "python")
cmd_line = get_cmd_line(args)
args[1:1] = ("-m", "memory_profiler", "--timestamp",
"-o", mprofile_output)
#print(" ".join(args))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debug print left here

p = subprocess.Popen(args)
else:
cmd_line = get_cmd_line(args)
Expand Down