support GraalPy

This commit is contained in:
Skye 2026-01-30 13:35:42 +09:00
parent 22cdc0f8c9
commit 8418abc4ff
No known key found for this signature in database
GPG key ID: 0104BC05F41B77B8
3 changed files with 7 additions and 3 deletions

View file

@ -46,6 +46,8 @@ MACOS = platform.system() == "Darwin"
EXE = bool(getattr(sys, "frozen", False))
GRAAL = platform.python_implementation() == "GraalVM"
try:
CORES = len(os.sched_getaffinity(0))
except:

View file

@ -8,6 +8,7 @@ https://github.com/pydron/ifaddr/tree/0.2.0
"""
import os
import platform
from ._shared import IP, Adapter
@ -22,7 +23,7 @@ except:
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
get_adapters = nope
elif os.name == "nt":

View file

@ -45,6 +45,7 @@ except:
from .__init__ import (
ANYWIN,
EXE,
GRAAL,
MACOS,
PY2,
PY36,
@ -779,7 +780,7 @@ class Daemon(threading.Thread):
self.start()
def run(self):
if not ANYWIN and not PY2:
if not ANYWIN and not PY2 and not GRAAL:
signal.pthread_sigmask(
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():
if ANYWIN or PY2:
if ANYWIN or PY2 or GRAAL:
return
signal.pthread_sigmask(