Skip to content

Commit dca916e

Browse files
committed
Merge pull request #363 from stepan-anokhin/master
Handle multiline command-line args (Closes #210)
2 parents c9ae7d2 + e85f887 commit dca916e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎mprof.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import glob
22
import os
33
import os.path as osp
4+
import shlex
45
import sys
56
import re
67
import copy
@@ -175,8 +176,7 @@ def clean_action():
175176

176177
def get_cmd_line(args):
177178
"""Given a set or arguments, compute command-line."""
178-
blanks = set(' \t')
179-
args = [s if blanks.isdisjoint(s) else "'" + s + "'" for s in args]
179+
args = [shlex.quote(s).replace('\n', '\\n') for s in args]
180180
return ' '.join(args)
181181

182182
def find_first_process(name):

0 commit comments

Comments
 (0)