From dad7577826d8fa0da209b2836eaf022d8977a499 Mon Sep 17 00:00:00 2001 From: Oscar de la Torre Date: Tue, 2 May 2023 16:25:44 -0600 Subject: [PATCH] Using logging instead of print for timeout message Changing the method to print the informational message of `EXCESS TIME RECV_READY TIMEOUT, did you expect() before a send()` from print to logging.info --- paramiko_expect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paramiko_expect.py b/paramiko_expect.py index e63a50f..41a3043 100755 --- a/paramiko_expect.py +++ b/paramiko_expect.py @@ -19,6 +19,7 @@ import socket import struct import time +import logging # Windows does not have termios try: @@ -172,7 +173,7 @@ def expect( while not self.channel.closed and not self.channel.recv_ready(): time.sleep(.009) if time.time() >= (base_time + timeout): - print('EXCESS TIME RECV_READY TIMEOUT, did you expect() before a send()') + logging.info('EXCESS TIME RECV_READY TIMEOUT, did you expect() before a send()') return -1 # Read some of the output current_buffer = self.channel.recv(self.buffer_size)