fix: replace bare except with except BaseException in token_create#905
fix: replace bare except with except BaseException in token_create#905harshadkhetpal wants to merge 1 commit intoCheckmk:masterfrom
Conversation
|
I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
|
Thank you for your contribution. This pull request has been marked as stale as it has not passed the automated tests and there was no activity for the last 14 days. This pull request will be closed due to inactivity after 60 days, if no action is taken. |
Summary
Replace bare
except:clause withexcept BaseException:incmk/gui/dashboard/api/token_create.py(PEP 8 E722).Why: Bare
except:is equivalent toexcept BaseException:but is less explicit. Since this block performs a rollback and re-raises,except BaseException:is the correct explicit form — it documents the intent to catch everything during the rollback.Change:
Testing
No behavior change —
except BaseException:is semantically identical toexcept:but satisfies PEP 8 E722.