commit | b5255114d1221f3fec027005a16dc61812eacf4b | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Sun Mar 10 15:59:58 2002 +0000 |
committer | Martin v. Löwis <martin@v.loewis.de> | Sun Mar 10 15:59:58 2002 +0000 |
tree | bf6578f3624f2cbf182053ab4a48a09edec759c1 | |
parent | dfce3bf908f9f6e8b20d54ca5f724994f6790f8a [diff] |
Access the exception argument to see whether it starts with '500'. Fixes #527855.
diff --git a/Lib/ftplib.py b/Lib/ftplib.py index cad7a5b..aaf12fe 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py
@@ -487,8 +487,8 @@ try: return self.voidcmd('CDUP') except error_perm, msg: - if msg[:3] != '500': - raise error_perm, msg + if msg.args[0][:3] != '500': + raise elif dirname == '': dirname = '.' # does nothing, but could return error cmd = 'CWD ' + dirname