Skip to content

Commit 497c22a

Browse files
committed
fixup! Disable implicit conversions, that might lose information:
fixes for #1568
1 parent 1ca0bdb commit 497c22a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/runtime/converter.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,12 @@ internal static bool ToManagedValue(IntPtr value, Type obType,
361361
}
362362
result = cb.type.Value;
363363
return true;
364+
365+
case null:
366+
break;
367+
368+
default:
369+
throw new ArgumentException("We should never receive instances of other managed types");
364370
}
365371

366372
if (value == Runtime.PyNone && !obType.IsValueType)
@@ -513,7 +519,7 @@ internal static bool ToManagedValue(IntPtr value, Type obType,
513519
{
514520
if (setError)
515521
{
516-
Exceptions.SetError(ex.InnerException);
522+
Exceptions.SetError(ex);
517523
}
518524
return null;
519525
}

0 commit comments

Comments
 (0)