Skip to content

Commit 41ea981

Browse files
author
Jussi Kukkonen
committed
imports: Fix urllib3 exception import
Make it compatible with vendoring: import the exception only to avoid having to rename the module locally. Signed-off-by: Jussi Kukkonen <[email protected]>
1 parent 476746a commit 41ea981

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tuf/requests_fetcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
import six
1111
import logging
1212
import time
13-
14-
import urllib3.exceptions
13+
from urllib3.exceptions import ReadTimeoutError
1514

1615
from tuf import exceptions
1716
from tuf import settings
@@ -120,7 +119,7 @@ def chunks():
120119
if bytes_received >= required_length:
121120
break
122121

123-
except urllib3.exceptions.ReadTimeoutError as e:
122+
except ReadTimeoutError as e:
124123
raise exceptions.SlowRetrievalError(str(e))
125124

126125
finally:

0 commit comments

Comments
 (0)