colab check fix

This commit is contained in:
dawoodkhan82 2021-02-24 14:49:55 -05:00
parent 00ef4e47d0
commit 20d9bf2623
2 changed files with 6 additions and 5 deletions

View File

@ -403,6 +403,7 @@ class Interface:
is_colab = utils.colab_check() is_colab = utils.colab_check()
if is_colab or not(networking.url_ok(path_to_local_server)): if is_colab or not(networking.url_ok(path_to_local_server)):
share = True share = True
if is_colab:
if debug: if debug:
print(strings.en["COLAB_DEBUG_TRUE"]) print(strings.en["COLAB_DEBUG_TRUE"])
else: else:

View File

@ -310,6 +310,6 @@ def setup_tunnel(local_server_port):
def url_ok(url): def url_ok(url):
try: try:
r = requests.head(url) r = requests.head(url)
return r.status_code == 200 or r.status_code == 401 return r.status_code == 200
except (ConnectionError, requests.exceptions.ConnectionError): except (ConnectionError, requests.exceptions.ConnectionError):
return False return False