FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add an Action variant of TryUsingDll · morbitz/pythonnet@cc97b8a · GitHub

Repository navigation

Commit cc97b8a

Browse files
committed
Add an Action variant of TryUsingDll
1 parent e9283e3 commit cc97b8a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/runtime/Runtime.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,9 @@ internal static unsafe nint Refcount(BorrowedReference op)
672672
[Pure]
673673
internal static int Refcount32(BorrowedReference op) => checked((int)Refcount(op));
674674

675+
internal static void TryUsingDll(Action op) =>
676+
TryUsingDll(() => { op(); return 0; });
677+
675678
/// <summary>
676679
/// Call specified function, and handle PythonDLL-related failures.
677680
/// </summary>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL