Skip to content

fix: replace 55 bare except clauses with except Exception#1698

Open
haosenwang1018 wants to merge 1 commit intoopeninterpreter:mainfrom
haosenwang1018:fix/bare-excepts
Open

fix: replace 55 bare except clauses with except Exception#1698
haosenwang1018 wants to merge 1 commit intoopeninterpreter:mainfrom
haosenwang1018:fix/bare-excepts

Conversation

@haosenwang1018
Copy link

What

Replace 55 bare except: clauses with except Exception:.

Why

Bare except: catches BaseException, including KeyboardInterrupt and SystemExit, which can prevent clean process shutdown and mask critical errors. Using except Exception: catches all application-level errors while allowing system-level exceptions to propagate correctly.

Bare `except:` catches BaseException including KeyboardInterrupt and
SystemExit. Replaced 55 instances with `except Exception:`.
@endolith
Copy link
Contributor

endolith commented Feb 25, 2026

Does this just replace all such cases or does it consider the ones where it's intended to catch KeyboardException?

ffbb90b fb4b8ca are related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants