From c2c196a8b72da525a71c719265b8382f1861641c Mon Sep 17 00:00:00 2001 From: Florian Treurniet Date: Thu, 1 Aug 2019 22:10:06 +0200 Subject: [PATCH] Fix so that Runtime.PyModuleType is retrieved via Python.dll (#904) --- AUTHORS.md | 1 + CHANGELOG.md | 5 ++++- src/runtime/runtime.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index a45cf6d78..6c2817aeb 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -27,6 +27,7 @@ - David Lassonde ([@lassond](https://github.com/lassond)) - David Lechner ([@dlech](https://github.com/dlech)) - Dmitriy Se ([@dmitriyse](https://github.com/dmitriyse)) +- Florian Treurniet ([@ftreurni](https://github.com/ftreurni)) - He-chien Tsai ([@t3476](https://github.com/t3476)) - Inna Wiesel ([@inna-w](https://github.com/inna-w)) - Ivan Cronyn ([@cronan](https://github.com/cronan)) diff --git a/CHANGELOG.md b/CHANGELOG.md index ada979147..8027125e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. ### Fixed +- Fixed runtime that fails loading when using pythonnet in an environment + together with Nuitka + ## [2.4.0][] ### Added @@ -60,7 +63,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. - Fixed conversion of 'float' and 'double' values ([#486][i486]) - Fixed 'clrmethod' for python 2 ([#492][i492]) - Fixed double calling of constructor when deriving from .NET class ([#495][i495]) -- Fixed `clr.GetClrType` when iterating over `System` members ([#607][p607]) +- Fixed `clr.GetClrType` when iterating over `System` members ([#607][p607]) - Fixed `LockRecursionException` when loading assemblies ([#627][i627]) - Fixed errors breaking .NET Remoting on method invoke ([#276][i276]) - Fixed PyObject.GetHashCode ([#676][i676]) diff --git a/src/runtime/runtime.cs b/src/runtime/runtime.cs index a347651d0..efbaac1c5 100644 --- a/src/runtime/runtime.cs +++ b/src/runtime/runtime.cs @@ -205,7 +205,6 @@ internal static void Initialize(bool initSigs = false) PyNotImplemented = PyObject_GetAttrString(op, "NotImplemented"); PyBaseObjectType = PyObject_GetAttrString(op, "object"); - PyModuleType = PyObject_Type(op); PyNone = PyObject_GetAttrString(op, "None"); PyTrue = PyObject_GetAttrString(op, "True"); PyFalse = PyObject_GetAttrString(op, "False"); @@ -302,6 +301,7 @@ internal static void Initialize(bool initSigs = false) dllLocal = loader.Load(_PythonDll); } _PyObject_NextNotImplemented = loader.GetFunction(dllLocal, "_PyObject_NextNotImplemented"); + PyModuleType = loader.GetFunction(dllLocal, "PyModule_Type"); if (dllLocal != IntPtr.Zero) {