/// Export of Macro Py_XIncRef. Use XIncref instead.
/// Limit this function usage for Testing and Py_Debug builds
@@ -2270,10 +2300,6 @@ internal static void SetNoSiteFlag()
if (_PythonDll != "__Internal")
{
dllLocal = loader.Load(_PythonDll);
- if (dllLocal == IntPtr.Zero)
- {
- throw new Exception($"Cannot load {_PythonDll}");
- }
}
try
{
@@ -2617,8 +2643,8 @@ static Delegates()
}
catch (MissingMethodException e) when (libraryHandle == IntPtr.Zero)
{
- throw new MissingMethodException(
- "Did you forget to set Runtime.PythonDLL?" +
+ throw new BadPythonDllException(
+ "Runtime.PythonDLL was not set or does not point to a supported Python runtime DLL." +
" See https://github.com/pythonnet/pythonnet#embedding-python-in-net",
e);
}
@@ -2889,6 +2915,12 @@ static Delegates()
}
}
+ internal class BadPythonDllException : MissingMethodException
+ {
+ public BadPythonDllException(string message, Exception innerException)
+ : base(message, innerException) { }
+ }
+
public enum ShutdownMode
{
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy