From: Michael W. Hudson Date: Mon, 11 Mar 2002 10:20:36 +0000 (+0000) Subject: backport loewis' checkin of X-Git-Tag: v2.2.1c1~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ddf8e337027953dd7da4c599acc6bab98cfd962;p=thirdparty%2FPython%2Fcpython.git backport loewis' checkin of revision 1.66 of ftplib.py Access the exception argument to see whether it starts with '500'. Fixes #527855. --- diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 2eb3cb295604..01895fd66862 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -492,8 +492,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