[change] changed some functions to work with Python 3 and Windows

This commit is contained in:
marcel committed 2017-07-13 17:27:48 +02:00
1 parent ac25f9cacb
commit f57aa37d99
11 files changed
+47 -35

No files matched your search

+6 -3
View File
@@ -1,13 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
try:
from urllib2 import urlopen
except:
from urllib.request import urlopen
def checkurl(url='https://ariadne.geophysik.rub.de/trac/PyLoT'):
try:
urllib2.urlopen(url, timeout=1)
urlopen(url, timeout=1)
return True
except urllib2.URLError:
except:
pass
return False