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