Replies: 1 comment
|
Hi, after some investigation, it seems this issue can be fixed by the the following modification: src/runtime/Converter.cs | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/runtime/Converter.cs b/src/runtime/Converter.cs
index 50b33e6..6022402 100644
--- a/src/runtime/Converter.cs
+++ b/src/runtime/Converter.cs
@@ -327,7 +327,7 @@ namespace Python.Runtime
throw new ArgumentException("We should never receive instances of other managed types");
}
- if (value == Runtime.PyNone && !obType.IsValueType)
+ if (value == Runtime.PyNone)
{
result = null;
return true;
@@ -335,11 +335,6 @@ namespace Python.Runtime
if (obType.IsGenericType && obType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
- if (value == Runtime.PyNone)
- {
- result = null;
- return true;
- }
// Set type to underlying type
obType = obType.GetGenericArguments()[0];
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Environment
Details
Describe what you were trying to get done.
I passed a
Dictionary<int, float>to a python function and wanted to callitems()in it, but it threw an exception:If I use
Dictionary<int, object>, it works correctly.Minimal, Complete, and Verifiable example
this will help us understand the issue.
Run the following code in Python.EmbeddingTest project:
All reactions