summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-03-10 15:59:58 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-03-10 15:59:58 (GMT)
commitb5255114d1221f3fec027005a16dc61812eacf4b (patch)
treebf6578f3624f2cbf182053ab4a48a09edec759c1 /Lib/ftplib.py
parentdfce3bf908f9f6e8b20d54ca5f724994f6790f8a (diff)
downloadcpython-b5255114d1221f3fec027005a16dc61812eacf4b.zip
cpython-b5255114d1221f3fec027005a16dc61812eacf4b.tar.gz
cpython-b5255114d1221f3fec027005a16dc61812eacf4b.tar.bz2
Access the exception argument to see whether it starts with '500'.
Fixes #527855.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py4
1 files changed, 2 insertions, 2 deletions
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 @@ 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