(f: Callable[P, T])
| 515 | |
| 516 | |
| 517 | def 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 |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…