mirror of
https://github.com/wassname/ray.git
synced 2026-07-13 01:17:37 +08:00
Windows changes (#7315)
This commit is contained in:
+2
-11
@@ -32,7 +32,8 @@ sys.path.insert(0, thirdparty_files)
|
||||
|
||||
# Expose ray ABI symbols which may be dependent by other shared
|
||||
# libraries such as _streaming.so. See BUILD.bazel:_raylet
|
||||
so_path = os.path.join(dirname(__file__), "_raylet.so")
|
||||
python_shared_lib_suffix = ".so" if sys.platform != "win32" else ".pyd"
|
||||
so_path = os.path.join(dirname(__file__), "_raylet" + python_shared_lib_suffix)
|
||||
if os.path.exists(so_path):
|
||||
import ctypes
|
||||
from ctypes import CDLL
|
||||
@@ -158,13 +159,3 @@ __all__ += [
|
||||
"TaskID",
|
||||
"UniqueID",
|
||||
]
|
||||
|
||||
import ctypes # noqa: E402
|
||||
# Windows only
|
||||
if hasattr(ctypes, "windll"):
|
||||
# Makes sure that all child processes die when we die. Also makes sure that
|
||||
# fatal crashes result in process termination rather than an error dialog
|
||||
# (the latter is annoying since we have a lot of processes). This is done
|
||||
# by associating all child processes with a "job" object that imposes this
|
||||
# behavior.
|
||||
(lambda kernel32: (lambda job: (lambda n: kernel32.SetInformationJobObject(job, 9, "\0" * 17 + chr(0x8 | 0x4 | 0x20) + "\0" * (n - 18), n))(0x90 if ctypes.sizeof(ctypes.c_void_p) > ctypes.sizeof(ctypes.c_int) else 0x70) and kernel32.AssignProcessToJobObject(job, ctypes.c_void_p(kernel32.GetCurrentProcess())))(ctypes.c_void_p(kernel32.CreateJobObjectW(None, None))) if kernel32 is not None else None)(ctypes.windll.kernel32) # noqa: E501
|
||||
|
||||
Reference in New Issue
Block a user