-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: Fix if-else-block-instead-of-if-exp (SIM108) (part 3) #4570
style: Fix if-else-block-instead-of-if-exp (SIM108) (part 3) #4570
Conversation
…/temporal/gui_support.py
…ive() in grass.temporal.AbstractDataset
On my fork I think it's bandit that will complain about the use of eval, that is only moved around |
"" if keywords is None or keywords.text is None else keywords.text | ||
) | ||
shortcut = shortcut.text if shortcut is not None else "" | ||
wxId = eval("wx." + wxId.text) if wxId is not None else wx.ID_ANY |
Check warning
Code scanning / Bandit
Use of possibly insecure function - consider using safer ast.literal_eval. Warning
Co-authored-by: Anna Petrasova <[email protected]>
"" if keywords is None or keywords.text is None else keywords.text | ||
) | ||
shortcut = shortcut.text if shortcut is not None else "" | ||
wxId = eval("wx." + wxId.text) if wxId is not None else wx.ID_ANY |
Check warning
Code scanning / Bandit
Use of possibly insecure function - consider using safer ast.literal_eval.
Last PR of this series. It finishes by enabling checking the rule with ruff.
PRs in this series: #4562, #4561
Ruff rule: https://docs.astral.sh/ruff/rules/if-else-block-instead-of-if-exp