8000 Merge pull request #26 from Martin-Molinero/performance-qc2925-fix-ex… · saaib/pythonnet@f116429 · GitHub
[go: up one dir, main page]

Skip to content

Commit f116429

Browse files
authored
Merge pull request QuantConnect#26 from Martin-Molinero/performance-qc2925-fix-exception-cache
Remove ExceptionTypeCache
2 parents fcd62f6 + 3ce4608 commit f116429

File tree

7 files changed

+9
-16
lines changed

7 files changed

+9
-16
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.0.5.16
2+
current_version = 1.0.5.17
33
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
44
serialize =
55
{major}.{minor}.{patch}.{release}{dev}

conda.recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: pythonnet
3-
version: "1.0.5.16"
3+
version: "1.0.5.17"
44

55
build:
66
skip: True # [not win]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def run(self):
485485

486486
setup(
487487
name="pythonnet",
488-
version="1.0.5.16",
488+
version="1.0.5.17",
489489
description=".Net and Mono integration for Python",
490490
url='https://pythonnet.github.io/',
491491
license='MIT',

src/SharedAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
// Version Information. Keeping it simple. May need to revisit for Nuget
2626
// See: https://codingforsmarties.wordpress.com/2016/01/21/how-to-version-assemblies-destined-for-nuget/
2727
// AssemblyVersion can only be numeric
28-
[assembly: AssemblyVersion("1.0.5.16")]
28+
[assembly: AssemblyVersion("1.0.5.17")]

src/clrmodule/ClrModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static void initclr()
5353
{
5454
#if USE_PYTHON_RUNTIME_VERSION
5555
// Has no effect until SNK works. Keep updated anyways.
56-
Version = new Version("1.0.5.16"),
56+
Version = new Version("1.0.5.17"),
5757
#endif
5858
CultureInfo = CultureInfo.InvariantCulture
5959
};

src/runtime/interop.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,20 +125,13 @@ public static int Size(IntPtr ob)
125125
public static int ob_type;
126126
private static int ob_dict;
127127
private static int ob_data;
128-
private static readonly Dictionary<IntPtr, bool> ExceptionTypeCache = new Dictionary<IntPtr, bool>();
129128

130129
private static bool IsException(IntPtr pyObject)
131130
{
132-
bool res;
133131
var type = Runtime.PyObject_TYPE(pyObject);
134-
if (!ExceptionTypeCache.TryGetValue(type, out res))
135-
{
136-
res = Runtime.PyObjectType_TypeCheck(type, Exceptions.BaseException)
137-
|| Runtime.PyObjectType_TypeCheck(type, Runtime.PyTypeType)
138-
&& Runtime.PyType_IsSubtype(pyObject, Exceptions.BaseException);
139-
ExceptionTypeCache.Add(type, res);
140-
}
141-
return res;
132+
return Runtime.PyObjectType_TypeCheck(type, Exceptions.BaseException)
133+
|| Runtime.PyObjectType_TypeCheck(type, Runtime.PyTypeType)
134+
&& Runtime.PyType_IsSubtype(pyObject, Exceptions.BaseException);
142135
}
143136
}
144137

src/runtime/resources/clr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Code in this module gets loaded into the main clr module.
33
"""
44

5-
__version__ = "1.0.5.16"
5+
__version__ = "1.0.5.17"
66

77

88
class clrproperty(object):

0 commit comments

Comments
 (0)
0