Skip to content

Commit 3c458fd

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/runtime/converter.cs

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

366369
if (value == Runtime.PyNone && !obType.IsValueType)
@@ -513,7 +516,7 @@ internal static bool ToManagedValue(IntPtr value, Type obType,
513516
{
514517
if (setError)
515518
{
516-
Exceptions.SetError(ex.InnerException);
519+
Exceptions.SetError(ex);
517520
}
518521
return null;
519522
}

0 commit comments

Comments
 (0)