Kaydet (Commit) 3ddf8e33 authored tarafından Michael W. Hudson's avatar Michael W. Hudson

backport loewis' checkin of

    revision 1.66 of ftplib.py

Access the exception argument to see whether it starts with '500'.
Fixes #527855.
üst fd268a19
...@@ -492,8 +492,8 @@ class FTP: ...@@ -492,8 +492,8 @@ class FTP:
try: try:
return self.voidcmd('CDUP') return self.voidcmd('CDUP')
except error_perm, msg: except error_perm, msg:
if msg[:3] != '500': if msg.args[0][:3] != '500':
raise error_perm, msg raise
elif dirname == '': elif dirname == '':
dirname = '.' # does nothing, but could return error dirname = '.' # does nothing, but could return error
cmd = 'CWD ' + dirname cmd = 'CWD ' + dirname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment