forked from platformio/platformio-core
Check PIO download storage for "Internet ON"
This commit is contained in:
1 parent
a53a38b5dd
commit
e2811a4a28
2 files changed
+10
-9
No files matched your search
+9
-8
@@ -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