online module: Don't fail when offline
If the system is offline, socket.gaierror is raised, the module crashes, and shows `offline` indefinitely. Catch that exception, and return False.
This commit is contained in:
parent
c287204321
commit
aeec2e86f3
@ -373,7 +373,7 @@ class internet:
|
||||
try:
|
||||
socket.create_connection(cls.address, 1).close()
|
||||
return True
|
||||
except OSError:
|
||||
except (OSError, socket.gaierror):
|
||||
return False
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user