Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.0.5.21
current_version = 1.0.5.23
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.{release}{dev}
Expand Down
2 changes: 1 addition & 1 deletion conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: pythonnet
version: "1.0.5.21"
version: "1.0.5.23"

build:
skip: True # [not win]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def run(self):

setup(
name="pythonnet",
version="1.0.5.21",
version="1.0.5.23",
description=".Net and Mono integration for Python",
url='https://pythonnet.github.io/',
license='MIT',
Expand Down
2 changes: 1 addition & 1 deletion src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
// Version Information. Keeping it simple. May need to revisit for Nuget
// See: https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/
// AssemblyVersion can only be numeric
[assembly: AssemblyVersion("1.0.5.21")]
[assembly: AssemblyVersion("1.0.5.23")]
2 changes: 1 addition & 1 deletion src/clrmodule/ClrModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void initclr()
{
#if USE_PYTHON_RUNTIME_VERSION
// Has no effect until SNK works. Keep updated anyways.
Version = new Version("1.0.5.21"),
Version = new Version("1.0.5.23"),
#endif
CultureInfo = CultureInfo.InvariantCulture
};
Expand Down
6 changes: 5 additions & 1 deletion src/runtime/pythonengine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -164,6 +164,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
// during an initial "import clr", and the world ends shortly thereafter.
// This is probably masking some bad mojo happening somewhere in Runtime.Initialize().
delegateManager = new DelegateManager();
Console.WriteLine("PythonEngine.Initialize(): Runtime.Initialize()...");
Runtime.Initialize();
initialized = true;
Exceptions.Clear();
Expand All @@ -179,9 +180,11 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
string code =
"import atexit, clr\n" +
"atexit.register(clr._AtExit)\n";
Console.WriteLine("PythonEngine.Initialize(): register atexit callback...");
PythonEngine.Exec(code);

// Load the clr.py resource into the clr module
Console.WriteLine("PythonEngine.Initialize(): GetCLRModule()...");
IntPtr clr = Python.Runtime.ImportHook.GetCLRModule();
IntPtr clr_dict = Runtime.PyModule_GetDict(clr);

Expand All @@ -193,6 +196,7 @@ public static void Initialize(IEnumerable<string> args, bool setSysArgv = true)
IntPtr builtins = Runtime.PyEval_GetBuiltins();
Runtime.PyDict_SetItemString(module_globals, "__builtins__", builtins);

Console.WriteLine("PythonEngine.Initialize(): clr GetManifestResourceStream...");
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream = assembly.GetManifestResourceStream("clr.py"))
using (var reader = new StreamReader(stream))
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/resources/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Code in this module gets loaded into the main clr module.
"""

__version__ = "1.0.5.21"
__version__ = "1.0.5.23"


class clrproperty(object):
Expand Down
7 changes: 6 additions & 1 deletion src/runtime/runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,18 @@ internal static void Initialize()
{
if (Py_IsInitialized() == 0)
{
Console.WriteLine("Runtime.Initialize(): Py_Initialize...");
Py_Initialize();
MainManagedThreadId = Thread.CurrentThread.ManagedThreadId;
}

if (PyEval_ThreadsInitialized() == 0)
{
Console.WriteLine("Runtime.Initialize(): PyEval_InitThreads...");
PyEval_InitThreads();
}

Console.WriteLine("Runtime.Initialize(): Initialize types...");
IntPtr op;
IntPtr dict;
if (IsPython3)
Expand Down Expand Up @@ -326,6 +329,7 @@ internal static void Initialize()
XDecref(c);
XDecref(d);
#endif
Console.WriteLine("Runtime.Initialize(): Initialize types end.");

Error = new IntPtr(-1);

Expand All @@ -343,7 +347,7 @@ internal static void Initialize()
NativeMethods.FreeLibrary(dllLocal);
}
#endif

Console.WriteLine("Runtime.Initialize(): AssemblyManager.Initialize()...");
// Initialize modules that depend on the runtime class.
AssemblyManager.Initialize();
PyCLRMetaType = MetaType.Initialize();
Expand All @@ -357,6 +361,7 @@ internal static void Initialize()
IntPtr item = PyString_FromString(rtdir);
PyList_Append(path, item);
XDecref(item);
Console.WriteLine("Runtime.Initialize(): AssemblyManager.UpdatePath()...");
AssemblyManager.UpdatePath();
}

Expand Down