MCPcopy Create free account
hub / github.com/libgit2/pygit2 / __exit__

Method __exit__

pygit2/transaction.py:185–194  ·  view source on GitHub ↗
(self, exc_type, exc_val, exc_tb)

Source from the content-addressed store, hash-verified

183 return self
184
185 def __exit__(self, exc_type, exc_val, exc_tb) -> None:
186 self._check_thread()
187 # Only commit if no exception occurred
188 if exc_type is None and self._tx is not None:
189 self.commit()
190
191 # Always free the transaction
192 if self._tx is not None:
193 C.git_transaction_free(self._tx)
194 self._tx = None
195
196 def __del__(self) -> None:
197 if self._tx is not None:

Callers

nothing calls this directly

Calls 2

_check_threadMethod · 0.95
commitMethod · 0.95

Tested by

no test coverage detected