File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -385,8 +385,8 @@ async def _request(
385
385
386
386
try :
387
387
url = URL (str_or_url )
388
- except ValueError :
389
- raise InvalidURL (str_or_url )
388
+ except ValueError as e :
389
+ raise InvalidURL (str_or_url ) from e
390
390
391
391
skip_headers = set (self ._skip_auto_headers )
392
392
if skip_auto_headers is not None :
@@ -396,8 +396,8 @@ async def _request(
396
396
if proxy is not None :
397
397
try :
398
398
proxy = URL (proxy )
399
- except ValueError :
400
- raise InvalidURL (proxy )
399
+ except ValueError as e :
400
+ raise InvalidURL (proxy ) from e
401
401
402
402
if timeout is sentinel :
403
403
real_timeout = self ._timeout # type: ClientTimeout
@@ -570,8 +570,8 @@ async def _request(
570
570
parsed_url = URL (
571
571
r_url , encoded = not self ._requote_redirect_url )
572
572
573
- except ValueError :
574
- raise InvalidURL (r_url )
573
+ except ValueError as e :
574
+ raise InvalidURL (r_url ) from e
575
575
576
576
scheme = parsed_url .scheme
577
577
if scheme not in ('http' , 'https' , '' ):
@@ -801,7 +801,7 @@ async def _ws_connect(
801
801
resp .history ,
802
802
message = exc .args [0 ],
803
803
status = resp .status ,
804
- headers = resp .headers )
804
+ headers = resp .headers ) from exc
805
805
else :
806
806
compress = 0
807
807
notakeover = False
You can’t perform that action at this time.
0 commit comments