mirror of
https://github.com/k4m4/kickthemout.git
synced 2024-11-22 13:04:25 +01:00
Fix #286 - URLError handling
This commit is contained in:
parent
e680a9baa7
commit
8202c984c5
@ -27,11 +27,17 @@ def shutdown():
|
|||||||
|
|
||||||
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy!
|
logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up scapy!
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
from scapy.config import conf
|
from scapy.config import conf
|
||||||
conf.ipv6_enabled = False
|
conf.ipv6_enabled = False
|
||||||
from scapy.all import *
|
from scapy.all import *
|
||||||
|
except:
|
||||||
|
from scapy3k.config import conf
|
||||||
|
conf.ipv6_enabled = False
|
||||||
|
from scapy3k.all import *
|
||||||
import scan, spoof, nmap
|
import scan, spoof, nmap
|
||||||
from urllib.request import urlopen, Request
|
from urllib.request import urlopen, Request
|
||||||
|
from urllib.error import URLError
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
shutdown()
|
shutdown()
|
||||||
except:
|
except:
|
||||||
@ -128,7 +134,7 @@ def checkInternetConnection():
|
|||||||
try:
|
try:
|
||||||
urlopen('https://google.com', timeout=3)
|
urlopen('https://google.com', timeout=3)
|
||||||
return True
|
return True
|
||||||
except urllib.URLError as err:
|
except URLError as err:
|
||||||
return False
|
return False
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
shutdown()
|
shutdown()
|
||||||
|
Loading…
Reference in New Issue
Block a user