| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2518,7 +2518,19 @@ static Delegates() | |||
| 2518 | 2518 | } | |
| 2519 | 2519 | ||
| 2520 | 2520 | static global::System.IntPtr GetFunctionByName(string functionName, global::System.IntPtr libraryHandle) | |
| 2521 | - => libraryLoader.GetFunction(libraryHandle, functionName); | ||
| 2521 | + { | ||
| 2522 | + try | ||
| 2523 | + { | ||
| 2524 | + return libraryLoader.GetFunction(libraryHandle, functionName); | ||
| 2525 | + } | ||
| 2526 | + catch (MissingMethodException e) when (libraryHandle == IntPtr.Zero) | ||
| 2527 | + { | ||
| 2528 | + throw new MissingMethodException( | ||
| 2529 | + "Did you forget to set Runtime.PythonDLL?" + | ||
| 2530 | + " See https://github.com/pythonnet/pythonnet#embedding-python-in-net", | ||
| 2531 | + e); | ||
| 2532 | + } | ||
| 2533 | + } | ||
| 2522 | 2534 | ||
| 2523 | 2535 | internal static delegate* unmanaged[Cdecl]<IntPtr, IntPtr> PyDictProxy_New { get; } | |
| 2524 | 2536 | internal static delegate* unmanaged[Cdecl]<IntPtr, void> Py_IncRef { get; } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments