Skip to content

Commit 65a4c2f

Browse files
committed
add couldn't find python warning
1 parent 850a4b4 commit 65a4c2f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pwnlib/tubes/ssh.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,13 @@ def is_exe(path):
10751075

10761076
try:
10771077
python.recvline_contains(b'PWNTOOLS') # Magic flag so that any sh/bash initialization errors are swallowed
1078-
if b'python' not in python.recvline(): # Python interpreter that was selected
1078+
try:
1079+
if b'python' not in python.recvline(): # Python interpreter that was selected
1080+
self.warn_once('Could not find a Python interpreter on %s\n' % self.host
1081+
+ "Use ssh.run() instead of ssh.process()\n")
1082+
h.failure("Process creation failed")
1083+
return None
1084+
except (EOFError, ValueError):
10791085
self.warn_once('Could not find a Python interpreter on %s\n' % self.host
10801086
+ "Use ssh.system() instead of ssh.process()\n")
10811087
h.failure("Process creation failed")

0 commit comments

Comments
 (0)