From b88e72f099d2331bc768b74f81bfcc9fab158ab5 Mon Sep 17 00:00:00 2001 From: Martin Molinero Date: Thu, 21 Feb 2019 15:14:22 -0300 Subject: [PATCH 1/2] Remove ExceptionTypeCache - Removing `ExceptionTypeCache` which was causing issues and fix for issue caused performance overhead. --- src/runtime/interop.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/runtime/interop.cs b/src/runtime/interop.cs index 7ead0b1d2..5168bcd98 100644 --- a/src/runtime/interop.cs +++ b/src/runtime/interop.cs @@ -125,20 +125,13 @@ public static int Size(IntPtr ob) public static int ob_type; private static int ob_dict; private static int ob_data; - private static readonly Dictionary ExceptionTypeCache = new Dictionary(); private static bool IsException(IntPtr pyObject) { - bool res; var type = Runtime.PyObject_TYPE(pyObject); - if (!ExceptionTypeCache.TryGetValue(type, out res)) - { - res = Runtime.PyObjectType_TypeCheck(type, Exceptions.BaseException) - || Runtime.PyObjectType_TypeCheck(type, Runtime.PyTypeType) - && Runtime.PyType_IsSubtype(pyObject, Exceptions.BaseException); - ExceptionTypeCache.Add(type, res); - } - return res; + return Runtime.PyObjectType_TypeCheck(type, Exceptions.BaseException) + || Runtime.PyObjectType_TypeCheck(type, Runtime.PyTypeType) + && Runtime.PyType_IsSubtype(pyObject, Exceptions.BaseException); } } From 3ce460841c5d9422636cf00571b63ee94fad46c4 Mon Sep 17 00:00:00 2001 From: Martin Molinero Date: Thu, 21 Feb 2019 15:23:52 -0300 Subject: [PATCH 2/2] Bumping version to 1.5.0.17 --- .bumpversion.cfg | 2 +- conda.recipe/meta.yaml | 2 +- setup.py | 2 +- src/SharedAssemblyInfo.cs | 2 +- src/clrmodule/ClrModule.cs | 2 +- src/runtime/resources/clr.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7ea53f6ba..4be598ac8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.0.5.16 +current_version = 1.0.5.17 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? serialize = {major}.{minor}.{patch}.{release}{dev} diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 497adf5a0..1e85fffac 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -1,6 +1,6 @@ package: name: pythonnet - version: "1.0.5.16" + version: "1.0.5.17" build: skip: True # [not win] diff --git a/setup.py b/setup.py index 03fe25456..42230e099 100644 --- a/setup.py +++ b/setup.py @@ -485,7 +485,7 @@ def run(self): setup( name="pythonnet", - version="1.0.5.16", + version="1.0.5.17", description=".Net and Mono integration for Python", url='https://pythonnet.github.io/', license='MIT', diff --git a/src/SharedAssemblyInfo.cs b/src/SharedAssemblyInfo.cs index c17676f61..ba4cfde67 100644 --- a/src/SharedAssemblyInfo.cs +++ b/src/SharedAssemblyInfo.cs @@ -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.16")] +[assembly: AssemblyVersion("1.0.5.17")] diff --git a/src/clrmodule/ClrModule.cs b/src/clrmodule/ClrModule.cs index b198df56b..2d08d31ee 100644 --- a/src/clrmodule/ClrModule.cs +++ b/src/clrmodule/ClrModule.cs @@ -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.16"), + Version = new Version("1.0.5.17"), #endif CultureInfo = CultureInfo.InvariantCulture }; diff --git a/src/runtime/resources/clr.py b/src/runtime/resources/clr.py index c31118458..279d7f4f2 100644 --- a/src/runtime/resources/clr.py +++ b/src/runtime/resources/clr.py @@ -2,7 +2,7 @@ Code in this module gets loaded into the main clr module. """ -__version__ = "1.0.5.16" +__version__ = "1.0.5.17" class clrproperty(object):