8000 Remove ExceptionTypeCache by Martin-Molinero · Pull Request #26 · QuantConnect/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

Remove ExceptionTypeCache #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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.16
current_version = 1.0.5.17
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.16"
version: "1.0.5.17"

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.16",
version="1.0.5.17",
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.16")]
[assembly: AssemblyVersion("1.0.5.17")]
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.16"),
Version = new Version("1.0.5.17"),
#endif
CultureInfo = CultureInfo.InvariantCulture
};
Expand Down
13 changes: 3 additions & 10 deletions src/runtime/interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IntPtr, bool> ExceptionTypeCache = new Dictionary<IntPtr, bool>();

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);
}
}

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.16"
__version__ = "1.0.5.17"


class clrproperty(object):
Expand Down
0