Access the exception argument to see whether it starts with '500'.
Fixes #527855.
This commit is contained in:
parent
dfce3bf908
commit
b5255114d1
|
@ -487,8 +487,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
|
||||||
|
|
Loading…
Reference in New Issue