From 2c6de179b000e5768bee2b0ca5db1ec423c1c678 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 30 Aug 2024 12:20:13 -0700 Subject: [PATCH] feat: delete version check file on uncaught exceptions --- aider/report.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aider/report.py b/aider/report.py index 8ecbbd158..beb4f6beb 100644 --- a/aider/report.py +++ b/aider/report.py @@ -8,6 +8,7 @@ import webbrowser from aider import __version__ from aider.urls import github_issues +from aider.versioncheck import VERSION_CHECK_FNAME FENCE = "`" * 3 @@ -91,6 +92,13 @@ def exception_handler(exc_type, exc_value, exc_traceback): # We don't want any more exceptions sys.excepthook = None + # Check if VERSION_CHECK_FNAME exists and delete it if so + try: + if VERSION_CHECK_FNAME.exists(): + VERSION_CHECK_FNAME.unlink() + except Exception: + pass # Swallow any errors + # Format the traceback tb_lines = traceback.format_exception(exc_type, exc_value, exc_traceback)