From a71d2b2c51c61c958e01bb59f3543e8b68ce3ed9 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 12 Jan 1995 12:42:09 +0000 Subject: [PATCH] improve treatment of multi-line replies, ignore empty lines git-svn-id: http://svn.python.org/projects/python/trunk@4595 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Demo/sockets/ftp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Demo/sockets/ftp.py b/Demo/sockets/ftp.py index 1b672d3fc9..2d492398c7 100755 --- a/Demo/sockets/ftp.py +++ b/Demo/sockets/ftp.py @@ -114,7 +114,7 @@ def getreply(f): line = f.readline() if not line: break # Really an error print line, - if line[:3] == code: break + if line[:3] == code and line[3:4] != '-': break return code @@ -134,7 +134,9 @@ def getdata(r): # def getcommand(): try: - return raw_input('ftp.py> ') + while 1: + line = raw_input('ftp.py> ') + if line: return line except EOFError: return '' -- 2.11.4.GIT