mirror of
https://github.com/9001/copyparty.git
synced 2026-02-26 21:43:08 -07:00
support GraalPy
This commit is contained in:
parent
22cdc0f8c9
commit
8418abc4ff
|
|
@ -46,6 +46,8 @@ MACOS = platform.system() == "Darwin"
|
||||||
|
|
||||||
EXE = bool(getattr(sys, "frozen", False))
|
EXE = bool(getattr(sys, "frozen", False))
|
||||||
|
|
||||||
|
GRAAL = platform.python_implementation() == "GraalVM"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
CORES = len(os.sched_getaffinity(0))
|
CORES = len(os.sched_getaffinity(0))
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ https://github.com/pydron/ifaddr/tree/0.2.0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
|
|
||||||
from ._shared import IP, Adapter
|
from ._shared import IP, Adapter
|
||||||
|
|
||||||
|
|
@ -22,7 +23,7 @@ except:
|
||||||
S390X = False
|
S390X = False
|
||||||
|
|
||||||
|
|
||||||
if os.environ.get("PRTY_NO_IFADDR") or S390X:
|
if os.environ.get("PRTY_NO_IFADDR") or S390X or platform.python_implementation() == "GraalVM":
|
||||||
# s390x deadlocks at libc.getifaddrs
|
# s390x deadlocks at libc.getifaddrs
|
||||||
get_adapters = nope
|
get_adapters = nope
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ except:
|
||||||
from .__init__ import (
|
from .__init__ import (
|
||||||
ANYWIN,
|
ANYWIN,
|
||||||
EXE,
|
EXE,
|
||||||
|
GRAAL,
|
||||||
MACOS,
|
MACOS,
|
||||||
PY2,
|
PY2,
|
||||||
PY36,
|
PY36,
|
||||||
|
|
@ -779,7 +780,7 @@ class Daemon(threading.Thread):
|
||||||
self.start()
|
self.start()
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
if not ANYWIN and not PY2:
|
if not ANYWIN and not PY2 and not GRAAL:
|
||||||
signal.pthread_sigmask(
|
signal.pthread_sigmask(
|
||||||
signal.SIG_BLOCK, [signal.SIGINT, signal.SIGTERM, signal.SIGUSR1]
|
signal.SIG_BLOCK, [signal.SIGINT, signal.SIGTERM, signal.SIGUSR1]
|
||||||
)
|
)
|
||||||
|
|
@ -1656,7 +1657,7 @@ def log_thrs(log: Callable[[str, str, int], None], ival: float, name: str) -> No
|
||||||
|
|
||||||
|
|
||||||
def sigblock():
|
def sigblock():
|
||||||
if ANYWIN or PY2:
|
if ANYWIN or PY2 or GRAAL:
|
||||||
return
|
return
|
||||||
|
|
||||||
signal.pthread_sigmask(
|
signal.pthread_sigmask(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue