diff options
author | Georg Brandl <georg@python.org> | 2009-04-05 10:48:47 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-05 10:48:47 +0000 |
commit | 50ba6e1b50af3603414cf9c760090e8eba0eb347 (patch) | |
tree | 1e19bc0a95fdd0aab33b578f528286ac2020db0c /Lib/ftplib.py | |
parent | 5d19610f8d12ad179a24db13b10b54dfdf36ab3e (diff) | |
download | cpython-git-50ba6e1b50af3603414cf9c760090e8eba0eb347.tar.gz |
#1726172: dont raise an unexpected IndexError if a voidresp() call has an empty response.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r-- | Lib/ftplib.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 807bc383ee..222e77d654 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -221,7 +221,7 @@ class FTP: def voidresp(self): """Expect a response beginning with '2'.""" resp = self.getresp() - if resp[0] != '2': + if resp[:1] != '2': raise error_reply, resp return resp @@ -520,8 +520,6 @@ class FTP: resp = self.sendcmd('DELE ' + filename) if resp[:3] in ('250', '200'): return resp - elif resp[:1] == '5': - raise error_perm, resp else: raise error_reply, resp |