mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
refactoring
This commit is contained in:
@@ -34,10 +34,10 @@ def is_ipv6_enabled() -> bool:
|
||||
with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as sock:
|
||||
sock.bind(("::1", 0))
|
||||
return True
|
||||
except OSError as err:
|
||||
if err.errno in [errno.EADDRNOTAVAIL, errno.EAFNOSUPPORT]:
|
||||
except OSError as ex:
|
||||
if ex.errno in [errno.EADDRNOTAVAIL, errno.EAFNOSUPPORT]:
|
||||
return False
|
||||
if err.errno == errno.EADDRINUSE:
|
||||
if ex.errno == errno.EADDRINUSE:
|
||||
return True
|
||||
raise
|
||||
|
||||
|
||||
Reference in New Issue
Block a user