kopia lustrzana https://github.com/micropython/micropython-lib
upip: Report host name resolve error in user friendly manner.
rodzic
068988085e
commit
a86e7cf5a7
|
@ -105,7 +105,10 @@ warn_ussl = True
|
||||||
def url_open(url):
|
def url_open(url):
|
||||||
global warn_ussl
|
global warn_ussl
|
||||||
proto, _, host, urlpath = url.split('/', 3)
|
proto, _, host, urlpath = url.split('/', 3)
|
||||||
|
try:
|
||||||
ai = usocket.getaddrinfo(host, 443)
|
ai = usocket.getaddrinfo(host, 443)
|
||||||
|
except OSError as e:
|
||||||
|
fatal("Unable to resolve %s (no Internet?)" % host, e)
|
||||||
#print("Address infos:", ai)
|
#print("Address infos:", ai)
|
||||||
addr = ai[0][4]
|
addr = ai[0][4]
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue