Dulwich.io dulwich / a12b83e
Make sure idx/pack are always closed. Jelmer Vernooń≥ 27 days ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
515515 return super(FilePackIndex, self).__eq__(other)
516516
517517 def close(self):
518 self._file.close()
519518 if getattr(self._contents, "close", None) is not None:
520519 self._contents.close()
520 self._file.close()
521521
522522 def __len__(self):
523523 """Return the number of entries in this pack index."""
19331933 def from_objects(self, data, idx):
19341934 """Create a new pack object from pack data and index objects."""
19351935 ret = Pack('')
1936 ret._data_load = lambda: data
1937 ret._idx_load = lambda: idx
1936 ret._data = data
1937 ret._idx = idx
19381938 return ret
19391939
19401940 def name(self):