Fix SystemExit traceback during atexit cleanup on Ctrl+C
The browser_tool signal handler calls sys.exit(130) which raises SystemExit. When this fires during terminal_tool's atexit cleanup (specifically during _cleanup_thread.join()), it produces an unhandled traceback. Wrapping the join in a try/except suppresses the race without changing shutdown behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
dcf370cb6e
commit
254aafb265
1 changed files with 4 additions and 1 deletions
|
|
@ -617,7 +617,10 @@ def _stop_cleanup_thread():
|
||||||
global _cleanup_running
|
global _cleanup_running
|
||||||
_cleanup_running = False
|
_cleanup_running = False
|
||||||
if _cleanup_thread is not None:
|
if _cleanup_thread is not None:
|
||||||
_cleanup_thread.join(timeout=5)
|
try:
|
||||||
|
_cleanup_thread.join(timeout=5)
|
||||||
|
except (SystemExit, KeyboardInterrupt):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_active_environments_info() -> Dict[str, Any]:
|
def get_active_environments_info() -> Dict[str, Any]:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue