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

Function libgit2_callback_void

pygit2/callbacks.py:517–534  ·  view source on GitHub ↗
(f: Callable[P, T])

Source from the content-addressed store, hash-verified

515
516
517def libgit2_callback_void(f: Callable[P, T]) -> Callable[P, T]:
518 @wraps(f)
519 def wrapper(*args):
520 data = ffi.from_handle(args[-1])
521 args = args[:-1] + (data,)
522 try:
523 f(*args)
524 except Passthrough:
525 # A user defined callback can raise Passthrough to decline to act;
526 # then libgit2 will behave as if there was no callback set in the
527 # first place.
528 pass # Function returns void
529 except BaseException as e:
530 # Keep the exception to be re-raised later
531 data._stored_exception = e
532 pass # Function returns void, so we can't do much here.
533
534 return ffi.def_extern()(wrapper) # type: ignore[attr-defined]
535
536
537@libgit2_callback

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…