fix: Replace bare except clauses with specific exception types in Python utilities#2633
Conversation
This commit improves PEP 8 compliance and code robustness by replacing bare except clauses with specific exception types in Python utility files. Changes: - SU2/__init__.py: Use ImportError for optional readline import - SU2/io/config.py: Use Exception for config file error handling - SU2/util/ordered_bunch.py: Use Exception and (KeyError, TypeError) - SU2/util/bunch.py: Use Exception and (KeyError, TypeError) These changes maintain the original error-handling behavior while making exception handling more explicit and maintainable. All modified files pass Python syntax validation. Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
|
/label code-quality |
|
Thanks! There is no need to write these long descriptions for these simple changes - I guess they are chat descriptions? You can leave the bullet point description. |
Thanks for the feedback! I'll keep the descriptions concise and stick to bullet points for simple changes in the future. I included the detailed description just to ensure I was strictly following the PR template guidelines. |
Any other changes needed in this PR? |
Signed-off-by: shbhmexe <shubhushukla586@gmail.com>
|
Any other fixes required? |
|
Maintaining SU2 is not a full-time job for any of us. I don't need daily reminders to merge 7 line changes. |
|
@pcarruscag Got it, thanks for the clarification. I understand maintaining SU2 isn’t a full-time job and I’ll avoid sending reminders. Next time, I’ll focus on more substantial/core fixes when I get . Thanks for reviewing . |
Fixes remaining bare except clauses to improve PEP 8 compliance and code robustness:
ImportErrorfor optional readline import.Exceptionfor config file error handling.Exceptionand (KeyError, TypeError).Exceptionand(KeyError, TypeError).