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

Use contextlib's suppress method to silence an error #8668

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Jul 21, 2022

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhanced error handling in YOLOv5 model configuration parsing.

πŸ“Š Key Changes

  • Imported contextlib module.
  • Simplified the handling of NameErrors during model configuration parsing using contextlib.suppress instead of a try-except block.

🎯 Purpose & Impact

  • The purpose of this change is to streamline the code and make the error handling more readable and Pythonic.
  • The impact on users is likely minimal, as this is an internal code quality improvement. It could reduce the potential for future bugs and make the codebase easier to maintain. πŸ› οΈ

@glenn-jocher glenn-jocher self-assigned this Jul 21, 2022
@glenn-jocher glenn-jocher merged commit 4c1784b into master Jul 21, 2022
@glenn-jocher glenn-jocher deleted the glenn-jocher-patch-1 branch July 21, 2022 21:12
ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this pull request Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant