From a38b1f98eac793660285d253f9b70bd44b8a3440 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 27 Oct 2018 07:24:30 +0200 Subject: [PATCH] Undefined name 'urllib2' (#407) --- main/states/internet_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/states/internet_test.py b/main/states/internet_test.py index f5c6aee6..f2c6e412 100644 --- a/main/states/internet_test.py +++ b/main/states/internet_test.py @@ -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