MCPcopy
hub / github.com/borgbackup/borg / __enter__

Method __enter__

src/borg/repository.py:184–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182 return f"<{self.__class__.__name__} {self._location}>"
183
184 def __enter__(self):
185 if self.do_create:
186 self.do_create = False
187 self.create()
188 self.created = True
189 try:
190 self.open(exclusive=bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock)
191 except Exception:
192 self.close()
193 raise
194 return self
195
196 def __exit__(self, exc_type, exc_val, exc_tb):
197 self.close()

Callers

nothing calls this directly

Calls 3

createMethod · 0.95
openMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected