From 3ddf8e337027953dd7da4c599acc6bab98cfd962 Mon Sep 17 00:00:00 2001 From: "Michael W. Hudson" Date: Mon, 11 Mar 2002 10:20:36 +0000 Subject: [PATCH] backport loewis' checkin of revision 1.66 of ftplib.py Access the exception argument to see whether it starts with '500'. Fixes #527855. --- Lib/ftplib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.3