File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ def get_portable_python_url():
9696 systype = util .get_systype ()
9797 result = requests .get (
9898 "https://api.registry.platformio.org/v3/packages/"
99- "platformio/tool/python-portable"
99+ "platformio/tool/python-portable" ,
100+ timeout = 10 ,
100101 ).json ()
101102 versions = [
102103 version
Original file line number Diff line number Diff line change @@ -90,12 +90,12 @@ def safe_create_dir(path, raise_exception=False):
9090
9191def download_file (url , dst , cache = True ):
9292 if cache :
93- content_length = requests .head (url ).headers .get ("Content-Length" )
93+ content_length = requests .head (url , timeout = 10 ).headers .get ("Content-Length" )
9494 if os .path .isfile (dst ) and content_length == os .path .getsize (dst ):
9595 log .debug ("Getting from cache: %s" , dst )
9696 return dst
9797
98- resp = requests .get (url , stream = True )
98+ resp = requests .get (url , stream = True , timeout = 10 )
9999 itercontent = resp .iter_content (chunk_size = io .DEFAULT_BUFFER_SIZE )
100100 safe_create_dir (os .path .dirname (dst ))
101101 with open (dst , "wb" ) as fp :
You can’t perform that action at this time.
0 commit comments