FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use contextlib.suppress instead of except: pass by blablatdinov · Pull Request #113 · gitpython-developers/gitdb · GitHub

This repository was archived by the owner on Jul 26, 2026. It is now read-only.
/ gitdb Public archive

Use contextlib.suppress instead of except: pass - #113

Merged
Byron merged 1 commit into
gitpython-developers:masterfrom
blablatdinov:use-contextlib-suppress
Jun 10, 2024
Merged

Use contextlib.suppress instead of except: pass#113
Byron merged 1 commit into
gitpython-developers:masterfrom
blablatdinov:use-contextlib-suppress

Conversation

Copy link
Copy Markdown
Contributor

This PR refactors the LooseObjectDB class in gitdb/db/loose.py to utilize contextlib.suppress for handling KeyError exceptions, replacing the previous try-except block.

This change improves code readability and aligns with best practices for exception handling in Python.

Copy link
Copy Markdown
Contributor Author

@Byron Take a look please

Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, thank you!

Byron merged commit 88da5ef into gitpython-developers:master Jun 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL