Skip to content

fix: replace bare except with except BaseException in token_create#905

Open
harshadkhetpal wants to merge 1 commit intoCheckmk:masterfrom
harshadkhetpal:fix/bare-except-token-create
Open

fix: replace bare except with except BaseException in token_create#905
harshadkhetpal wants to merge 1 commit intoCheckmk:masterfrom
harshadkhetpal:fix/bare-except-token-create

Conversation

@harshadkhetpal
Copy link
Copy Markdown

Summary

Replace bare except: clause with except BaseException: in cmk/gui/dashboard/api/token_create.py (PEP 8 E722).

Why: Bare except: is equivalent to except 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:

# Before
except:
    # rollback token creation
    token_store.delete(token.token_id)
    raise

# After
except BaseException:
    # rollback token creation
    token_store.delete(token.token_id)
    raise

Testing

No behavior change — except BaseException: is semantically identical to except: but satisfies PEP 8 E722.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.

@github-actions
Copy link
Copy Markdown

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.
Please take a look at the ‘Checks’ section for details on the test results and make the necessary changes.

This pull request will be closed due to inactivity after 60 days, if no action is taken.

@github-actions github-actions Bot added the Stale Scheduled for auto-close label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stale Scheduled for auto-close

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant