|
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 | + withsuppress(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
|
|
0 commit comments