File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -310,15 +310,18 @@ def cmdline(command, is_msf=True):
310310 split_cmd = [x .strip () for x in command .split (" " ) if x ]
311311
312312 sys .stdout .flush ()
313-
314- proc = Popen (split_cmd , stdout = PIPE , bufsize = 1 )
315313 stdout_buff = []
316- for stdout_line in iter (proc .stdout .readline , b'' ):
317- stdout_buff += [stdout_line .rstrip ()]
318- if is_msf :
319- print ("(msf)>> {}" .format (stdout_line ).rstrip ())
320- else :
321- print ("{}" .format (stdout_line ).rstrip ())
314+
315+ try :
316+ proc = Popen (split_cmd , stdout = PIPE , bufsize = 1 )
317+ for stdout_line in iter (proc .stdout .readline , b'' ):
318+ stdout_buff += [stdout_line .rstrip ()]
319+ if is_msf :
320+ print ("(msf)>> {}" .format (stdout_line ).rstrip ())
321+ else :
322+ print ("{}" .format (stdout_line ).rstrip ())
323+ except OSError as e :
324+ stdout_buff += "ERROR: " + e
322325
323326 return stdout_buff
324327
You can’t perform that action at this time.
0 commit comments