Skip to content

Commit 6478e66

Browse files
committed
FIX: solve issue #181
1 parent 8a9b1b7 commit 6478e66

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

mprof

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,22 @@ def run_action():
208208
# .. TODO: more than one script as argument ? ..
209209
program = args.program
210210
if program[0].endswith('.py') and not args.nopython:
211-
if not program[0].startswith("python"):
212-
program.insert(0, sys.executable)
213211
if args.multiprocess:
214212
# in multiprocessing mode you want to spawn a separate
215213
# python process
214+
if not program[0].startswith("python"):
215+
program.insert(0, sys.executable)
216216
args.python = False
217+
else:
218+
args.python = True
217219
if args.python:
218220
print("running as a Python program...")
219221
if not program[0].startswith("python"):
220222
program.insert(0, sys.executable)
221223
cmd_line = get_cmd_line(program)
222224
program[1:1] = ("-m", "memory_profiler", "--timestamp",
223225
"-o", mprofile_output)
226+
print(program)
224227
p = subprocess.Popen(program)
225228
else:
226229
cmd_line = get_cmd_line(program)

0 commit comments

Comments
 (0)