mirror of
https://github.com/python/cpython.git
synced 2025-09-11 03:07:01 +00:00
improve treatment of multi-line replies, ignore empty lines
This commit is contained in:
parent
1134991fb1
commit
4f9181ee0b
1 changed files with 4 additions and 2 deletions
|
@ -114,7 +114,7 @@ def getreply(f):
|
||||||
line = f.readline()
|
line = f.readline()
|
||||||
if not line: break # Really an error
|
if not line: break # Really an error
|
||||||
print line,
|
print line,
|
||||||
if line[:3] == code: break
|
if line[:3] == code and line[3:4] != '-': break
|
||||||
return code
|
return code
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,7 +134,9 @@ def getdata(r):
|
||||||
#
|
#
|
||||||
def getcommand():
|
def getcommand():
|
||||||
try:
|
try:
|
||||||
return raw_input('ftp.py> ')
|
while 1:
|
||||||
|
line = raw_input('ftp.py> ')
|
||||||
|
if line: return line
|
||||||
except EOFError:
|
except EOFError:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue