Skip to content

Commit e37765e

Browse files
author
Ekultek
committed
fix for issue #1059
1 parent d5ff732 commit e37765e

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

lib/settings.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)