mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +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):
|
def internet_on(timeout=3):
|
||||||
host = "dl.bintray.com"
|
socket.setdefaulttimeout(timeout)
|
||||||
port = 443
|
for host in ("dl.bintray.com", "dl.platformio.org"):
|
||||||
try:
|
try:
|
||||||
socket.setdefaulttimeout(timeout)
|
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(
|
||||||
socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect((host, port))
|
(host, 80))
|
||||||
return True
|
return True
|
||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
return False
|
pass
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def get_pythonexe_path():
|
def get_pythonexe_path():
|
||||||
|
Reference in New Issue
Block a user