mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Check PIO download storage for "Internet ON"
This commit is contained in:
2
docs
2
docs
Submodule docs updated: 89630419d5...1666723f26
@ -540,14 +540,15 @@ def get_api_result(url, params=None, data=None, auth=None, cache_valid=None):
|
||||
|
||||
|
||||
def internet_on(timeout=3):
|
||||
host = "dl.bintray.com"
|
||||
port = 443
|
||||
try:
|
||||
socket.setdefaulttimeout(timeout)
|
||||
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
|
||||
return True
|
||||
except: # pylint: disable=bare-except
|
||||
return False
|
||||
socket.setdefaulttimeout(timeout)
|
||||
for host in ("dl.bintray.com", "dl.platformio.org"):
|
||||
try:
|
||||
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(
|
||||
(host, 80))
|
||||
return True
|
||||
except: # pylint: disable=bare-except
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
def get_pythonexe_path():
|
||||
|
Reference in New Issue
Block a user