Skip to content

Commit

Permalink
Undefined name 'urllib2' (#407)
Browse files Browse the repository at this point in the history
cclauss authored and hongquan committed Oct 27, 2018
1 parent 911383e commit a38b1f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main/states/internet_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
""" Function to test the internet connection
"""
import urllib.request
from urllib import URLError


def internet_on():
try:
urllib.request.urlopen('http://216.58.192.142', timeout=1) # nosec #pylint-disable type: ignore
return True # pylint-enable
except urllib2.URLError as err:
except URLError as err:
print(err)
return False

0 comments on commit a38b1f9

Please sign in to comment.