Dulwich.io dulwich / 24dcd78
Python2 compatibility. Jelmer Vernooń≥ 14 days ago
1 changed file(s) with 5 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1717 # License, Version 2.0.
1818 #
1919
20 import errno
2021 import hashlib
2122 import os
2223 import tempfile
5051 """Open an object by sha."""
5152 try:
5253 return open(self._sha_path(sha), 'rb')
53 except FileNotFoundError:
54 raise KeyError(sha)
54 except (OSError, IOError) as e:
55 if e.errno == errno.ENOENT:
56 raise KeyError(sha)
57 raise
5558
5659 def write_object(self, chunks):
5760 """Write an object.