File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -2518,7 +2518,19 @@ static Delegates()
25182518 }
25192519
25202520 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+ }
25222534
25232535 internal static delegate * unmanaged[ Cdecl] < IntPtr , IntPtr > PyDictProxy_New { get ; }
25242536 internal static delegate * unmanaged[ Cdecl] < IntPtr , void > Py_IncRef { get ; }
You can’t perform that action at this time.
0 commit comments