summaryrefslogtreecommitdiff
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 320163be63..76fdd719cd 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1579,8 +1579,7 @@ class FTPHandler(BaseHandler):
headers = email.message_from_string(headers)
return addinfourl(fp, headers, req.full_url)
except ftplib.all_errors as exp:
- exc = URLError('ftp error: %r' % exp)
- raise exc.with_traceback(sys.exc_info()[2])
+ raise URLError(exp) from exp
def connect_ftp(self, user, passwd, host, port, dirs, timeout):
return ftpwrapper(user, passwd, host, port, dirs, timeout,