(self, pid: Optional[int])
| 887 | return None |
| 888 | |
| 889 | def _write_pid_file(self, pid: Optional[int]): |
| 890 | self._shared_browser_pid = pid |
| 891 | try: |
| 892 | if pid: |
| 893 | with open(self._pid_file, 'w', encoding='utf-8') as handle: |
| 894 | handle.write(str(pid)) |
| 895 | elif os.path.exists(self._pid_file): |
| 896 | os.remove(self._pid_file) |
| 897 | except Exception as e: |
| 898 | debug_logger.log_warning(f"[BrowserCaptcha] Token-{self.token_id} failed to write PID file: {e}") |
| 899 | |
| 900 | def _is_pid_running(self, pid: Optional[int]) -> bool: |
| 901 | if not pid: |
no test coverage detected