@@ -299,9 +299,7 @@ def _lifecycle_watcher_loop_win32(
299299 )
300300 while self .__lifecycle_watcher_active :
301301 # Wait on both events with 100ms timeout
302- result = _kernel32 .WaitForMultipleObjects (
303- 2 , handle_array , False , 100
304- )
302+ result = _kernel32 .WaitForMultipleObjects (2 , handle_array , False , 100 )
305303 if result == _WAIT_OBJECT_0 :
306304 # Start event signaled
307305 with contextlib .suppress (Exception ):
@@ -337,34 +335,32 @@ def signal_lifecycle_event(pid: int, start: bool) -> None:
337335 template = _LIFECYCLE_START_EVENT if start else _LIFECYCLE_STOP_EVENT
338336 event_name = template .format (pid = pid )
339337 # Need EVENT_MODIFY_STATE to call SetEvent
340- handle = _kernel32 .OpenEventW (
341- _EVENT_MODIFY_STATE , False , event_name
342- )
338+ handle = _kernel32 .OpenEventW (_EVENT_MODIFY_STATE , False , event_name )
343339 if handle :
344340 _kernel32 .SetEvent (handle )
345341 _kernel32 .CloseHandle (handle )
346342 else :
347343 signals = ScaleneSignals ()
348- sig = signals .start_profiling_signal if start else signals .stop_profiling_signal
344+ sig = (
345+ signals .start_profiling_signal
346+ if start
347+ else signals .stop_profiling_signal
348+ )
349349 os .kill (pid , sig )
350350
351351 def send_lifecycle_start_to_child (self , pid : int ) -> None :
352352 """Send a start-profiling signal to a child process (cross-platform)."""
353353 if sys .platform == "win32" :
354354 self .signal_lifecycle_event (pid , start = True )
355355 else :
356- self .__orig_kill (
357- pid , self .__signals .start_profiling_signal
358- )
356+ self .__orig_kill (pid , self .__signals .start_profiling_signal )
359357
360358 def send_lifecycle_stop_to_child (self , pid : int ) -> None :
361359 """Send a stop-profiling signal to a child process (cross-platform)."""
362360 if sys .platform == "win32" :
363361 self .signal_lifecycle_event (pid , start = False )
364362 else :
365- self .__orig_kill (
366- pid , self .__signals .stop_profiling_signal
367- )
363+ self .__orig_kill (pid , self .__signals .stop_profiling_signal )
368364
369365 def send_signal_to_children (
370366 self , child_pids : "Set[int]" , signal_type : signal .Signals
0 commit comments