(pid)
| 350 | |
| 351 | |
| 352 | def _is_process_running(pid): |
| 353 | if pid <= 0: |
| 354 | return False |
| 355 | if os.name == "posix": |
| 356 | try: |
| 357 | os.kill(pid, 0) |
| 358 | return True |
| 359 | except ProcessLookupError: |
| 360 | return False |
| 361 | except PermissionError: |
| 362 | # EPERM means process exists but we can't signal it |
| 363 | return True |
| 364 | elif sys.platform == "win32": |
| 365 | try: |
| 366 | _remote_debugging.RemoteUnwinder(pid) |
| 367 | except Exception: |
| 368 | return False |
| 369 | return True |
| 370 | else: |
| 371 | raise ValueError(f"Unsupported platform: {sys.platform}") |
| 372 | |
| 373 | |
| 374 | def sample( |
searching dependent graphs…