1. Armin Rigo
  2. cpython-withatomic

Commits

Guido van Rossum  committed 84923d9

improve treatment of multi-line replies, ignore empty lines

  • Participants
  • Parent commits 173dd00
  • Branches legacy-trunk

Comments (0)

Files changed (1)

File Demo/sockets/ftp.py

View file
 			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
 
 
 #
 def getcommand():
 	try:
-		return raw_input('ftp.py> ')
+		while 1:
+			line = raw_input('ftp.py> ')
+			if line: return line
 	except EOFError:
 		return ''