summaryrefslogtreecommitdiff
path: root/pwnlib/tubes/tube.py
diff options
context:
space:
mode:
Diffstat (limited to 'pwnlib/tubes/tube.py')
-rw-r--r--pwnlib/tubes/tube.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pwnlib/tubes/tube.py b/pwnlib/tubes/tube.py
index 0e5e9da..89ae3fc 100644
--- a/pwnlib/tubes/tube.py
+++ b/pwnlib/tubes/tube.py
@@ -875,7 +875,7 @@ class tube(Timeout, Logger):
go = threading.Event()
def recv_thread():
- while not go.isSet():
+ while not go.is_set():
try:
cur = self.recv(timeout = 0.05)
cur = cur.replace(self.newline, b'\n')
@@ -897,11 +897,11 @@ class tube(Timeout, Logger):
try:
os_linesep = os.linesep.encode()
to_skip = b''
- while not go.isSet():
+ while not go.is_set():
if term.term_mode:
data = term.readline.readline(prompt = prompt, float = True)
- if data:
- data += self.newline
+ if data.endswith(b'\n') and self.newline != b'\n':
+ data = data[:-1] + self.newline
else:
stdin = getattr(sys.stdin, 'buffer', sys.stdin)
data = stdin.read(1)