| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b653923 commit d50b2e3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,6 +2,8 @@ | |||
| 2 | 2 | # | |
| 3 | 3 | # This module is part of GitDB and is released under | |
| 4 | 4 | # the New BSD License: https://opensource.org/license/bsd-3-clause/ | |
| 5 | + from contextlib import suppress | ||
| 6 | + | ||
| 5 | 7 | from gitdb.db.base import ( | |
| 6 | 8 | FileDBBase, | |
| 7 | 9 | ObjectDBR, | |
@@ -90,10 +92,8 @@ def readable_db_object_path(self, hexsha): | |||
| 90 | 92 | """ | |
| 91 | 93 | :return: readable object path to the object identified by hexsha | |
| 92 | 94 | :raise BadObject: If the object file does not exist""" | |
| 93 | - try: | ||
| 95 | + with suppress(KeyError): | ||
| 94 | 96 | return self._hexsha_to_file[hexsha] | |
| 95 | - except KeyError: | ||
| 96 | - pass | ||
| 97 | 97 | # END ignore cache misses | |
| 98 | 98 | ||
| 99 | 99 | # try filesystem | |
| Back | FazBrowse Home | New Git URL |
0 commit comments