mirror of
https://github.com/9001/copyparty.git
synced 2026-02-26 21:43:08 -07:00
Update __init__.py
Signed-off-by: ed <s@ocv.me>
This commit is contained in:
parent
8418abc4ff
commit
591e959283
|
|
@ -17,20 +17,28 @@ def nope(include_unconfigured=False):
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
try:
|
host_os = platform.system()
|
||||||
S390X = os.uname().machine == "s390x"
|
machine = platform.machine()
|
||||||
except:
|
py_impl = platform.python_implementation()
|
||||||
S390X = False
|
|
||||||
|
|
||||||
|
|
||||||
if os.environ.get("PRTY_NO_IFADDR") or S390X or platform.python_implementation() == "GraalVM":
|
if os.environ.get("PRTY_NO_IFADDR"):
|
||||||
|
get_adapters = nope
|
||||||
|
elif machine in ("s390x",) or host_os in ("IRIX32",):
|
||||||
# s390x deadlocks at libc.getifaddrs
|
# s390x deadlocks at libc.getifaddrs
|
||||||
|
# irix libc does not have getifaddrs at all
|
||||||
|
print("ifaddr unavailable; can't determine LAN IP: unsupported OS")
|
||||||
|
get_adapters = nope
|
||||||
|
elif py_impl in ("GraalVM",):
|
||||||
|
print("ifaddr unavailable; can't determine LAN IP: unsupported interpreter")
|
||||||
get_adapters = nope
|
get_adapters = nope
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
from ._win32 import get_adapters
|
from ._win32 import get_adapters
|
||||||
elif os.name == "posix":
|
elif os.name == "posix":
|
||||||
from ._posix import get_adapters
|
from ._posix import get_adapters
|
||||||
else:
|
else:
|
||||||
raise RuntimeError("Unsupported Operating System: %s" % os.name)
|
print("ifaddr unavailable; can't determine LAN IP: unsupported OS")
|
||||||
|
get_adapters = nope
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["Adapter", "IP", "get_adapters"]
|
__all__ = ["Adapter", "IP", "get_adapters"]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue