From: Martin v. Löwis Date: Sun, 10 Mar 2002 15:59:58 +0000 (+0000) Subject: Access the exception argument to see whether it starts with '500'. X-Git-Tag: v2.3c1~6533 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5255114d1221f3fec027005a16dc61812eacf4b;p=thirdparty%2FPython%2Fcpython.git Access the exception argument to see whether it starts with '500'. Fixes #527855. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index cad7a5b90db4..aaf12fef6a24 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -487,8 +487,8 @@ class FTP: 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