Skip to content

Commit ae69594

Browse files
authored
updated for the python3 urllib merge
1 parent a0bc166 commit ae69594

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

check_internet_con.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/python3
2-
import urllib2
32

3+
try:
4+
# For Python 3.0 and later
5+
from urllib.request import urlopen
6+
except ImportError:
7+
# Fall back to Python 2's urllib2
8+
from urllib2 import urlopen
49

510
def checkInternetConnectivity():
611
try:

0 commit comments

Comments
 (0)