From f86fab7002399856acd988aad87868c78677b82e Mon Sep 17 00:00:00 2001 From: Cameron Patrick Date: Sun, 1 Aug 2004 06:39:06 +0000 Subject: [PATCH] add more debugging to write_expecting_echo --- sql-edition/servers/LATClient.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sql-edition/servers/LATClient.py b/sql-edition/servers/LATClient.py index ffa8963..dedc1ff 100644 --- a/sql-edition/servers/LATClient.py +++ b/sql-edition/servers/LATClient.py @@ -28,9 +28,14 @@ def write_expecting_echo(rfh, wfh, message): while len(message) > 0: wfh.write(message[0]) wfh.flush() - echo = rfh.read(1) - if echo != message[0]: - print "Gah, expected echo when writing", message[0] + if message[0] == '\n': + echo = rfh.read(2) + expected_echo = '\r\n' + else: + echo = rfh.read(1) + expected_echo = message[0] + if echo != expected_echo: + print "Gah, expected echo when writing", repr(message[0]), "but got", repr(echo) message = message[1:] print " --> Sent and echoed." -- 2.20.1