Kaydet (Commit) 901a2788 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

use correct format code for exceptions

üst 0ab18e4f
...@@ -2294,7 +2294,7 @@ class ftpwrapper: ...@@ -2294,7 +2294,7 @@ class ftpwrapper:
conn, retrlen = self.ftp.ntransfercmd(cmd) conn, retrlen = self.ftp.ntransfercmd(cmd)
except ftplib.error_perm as reason: except ftplib.error_perm as reason:
if str(reason)[:3] != '550': if str(reason)[:3] != '550':
raise URLError('ftp error: %d' % reason).with_traceback( raise URLError('ftp error: %r' % reason).with_traceback(
sys.exc_info()[2]) sys.exc_info()[2])
if not conn: if not conn:
# Set transfer mode to ASCII! # Set transfer mode to ASCII!
...@@ -2306,7 +2306,7 @@ class ftpwrapper: ...@@ -2306,7 +2306,7 @@ class ftpwrapper:
try: try:
self.ftp.cwd(file) self.ftp.cwd(file)
except ftplib.error_perm as reason: except ftplib.error_perm as reason:
raise URLError('ftp error: %d' % reason) from reason raise URLError('ftp error: %r' % reason) from reason
finally: finally:
self.ftp.cwd(pwd) self.ftp.cwd(pwd)
cmd = 'LIST ' + file cmd = 'LIST ' + file
......
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