Skip to content
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

Remove any usage of bare exception. #4331

Merged
merged 20 commits into from
Mar 26, 2024
Merged

Remove any usage of bare exception. #4331

merged 20 commits into from
Mar 26, 2024

Conversation

MaxJPRey
Copy link
Collaborator

@MaxJPRey MaxJPRey commented Mar 7, 2024

It's generally considered good practice to use except Exception as e: rather than a bare except: because it avoids catching some exceptions that you typically don't want to catch, like keyboard interrupts and system exits. It also allows you to access and use the actual exception object, which can be helpful for debugging.

@MaxJPRey MaxJPRey requested a review from SMoraisAnsys March 7, 2024 10:50
@ansys-reviewer-bot
Copy link
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions bot added documentation enhancement New features or code improvements labels Mar 7, 2024
SMoraisAnsys
SMoraisAnsys previously approved these changes Mar 7, 2024
@SMoraisAnsys
Copy link
Collaborator

@MaxJPRey To avoid codacy failure, I would recommand to not use except Exception as e: but except Exception: since e is never used afterward.

@MaxJPRey
Copy link
Collaborator Author

MaxJPRey commented Mar 8, 2024

@MaxJPRey To avoid codacy failure, I would recommand to not use except Exception as e: but except Exception: since e is never used afterward.

@SMoraisAnsys I fully agree. I will do it.

@SMoraisAnsys
Copy link
Collaborator

@MaxJPRey Since you are busy, feel free to let me do the changes. Just ping me so that I get notified 😄

@codecov-commenter
Copy link

codecov-commenter commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 4.77707% with 299 lines in your changes are missing coverage. Please review.

Project coverage is 34.63%. Comparing base (26a884b) to head (ec2c79c).

❗ Current head ec2c79c differs from pull request most recent head 4dfa409. Consider uploading reports for the commit 4dfa409 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4331       +/-   ##
===========================================
- Coverage   81.51%   34.63%   -46.89%     
===========================================
  Files         109      109               
  Lines       53162    53156        -6     
===========================================
- Hits        43337    18409    -24928     
- Misses       9825    34747    +24922     

@wiz-inc-572fc38784
Copy link

wiz-inc-572fc38784 bot commented Mar 15, 2024

Wiz Scan Summary

IaC Misconfigurations 0C 0H 0M 0L 0I
Vulnerabilities 0C 0H 0M 0L 0I
Sensitive Data 0C 0H 0M 0L 0I
Total 0C 0H 0M 0L 0I
Secrets 0🔑

@MaxJPRey
Copy link
Collaborator Author

@MaxJPRey Since you are busy, feel free to let me do the changes. Just ping me so that I get notified 😄

@SMoraisAnsys It is done.

@MaxJPRey MaxJPRey requested a review from SMoraisAnsys March 15, 2024 17:24
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 except Exception as e left. Otherwise, all good for me :)
Thanks for the huge refactoring

_unittest/test_01_Design.py Outdated Show resolved Hide resolved
_unittest/test_01_Design.py Outdated Show resolved Hide resolved
MaxJPRey and others added 3 commits March 18, 2024 09:12
Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com>
Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com>
SMoraisAnsys
SMoraisAnsys previously approved these changes Mar 19, 2024
@SMoraisAnsys SMoraisAnsys enabled auto-merge March 19, 2024 08:12
@Samuelopez-ansys Samuelopez-ansys dismissed stale reviews from SMoraisAnsys and themself via 2b49677 March 22, 2024 10:54
pyaedt/aedt_logger.py Outdated Show resolved Hide resolved
pyaedt/aedt_logger.py Outdated Show resolved Hide resolved
@Samuelopez-ansys Samuelopez-ansys enabled auto-merge (squash) March 22, 2024 13:28
@Samuelopez-ansys
Copy link
Member

@MaxJPRey I cancelled the workflow before, because there are some unit test failing, apart from Codacy that is complaining. I will debug next week and try to find the issue.

auto-merge was automatically disabled March 22, 2024 16:33

Base branch was modified

@MaxJPRey MaxJPRey enabled auto-merge (squash) March 22, 2024 17:38
Copy link
Collaborator

@SMoraisAnsys SMoraisAnsys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MaxJPRey MaxJPRey merged commit 00f8bd6 into main Mar 26, 2024
14 of 15 checks passed
@MaxJPRey MaxJPRey deleted the feat/exception branch March 26, 2024 17:27
SMoraisAnsys added a commit that referenced this pull request Mar 29, 2024
Co-authored-by: Sébastien Morais <146729917+SMoraisAnsys@users.noreply.github.com>
Co-authored-by: Samuel Lopez <85613111+Samuelopez-ansys@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features or code improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants