From e7e0838e472ec3d16eac469e01aec0b27ee62278 Mon Sep 17 00:00:00 2001 From: Bogdan Zavu Date: Fri, 4 Oct 2024 09:17:46 -0400 Subject: [PATCH] DYN-7521 : fix output value for bool type (#15525) Co-authored-by: Bogdan Zavu --- src/Libraries/DSCPython/CPythonEvaluator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Libraries/DSCPython/CPythonEvaluator.cs b/src/Libraries/DSCPython/CPythonEvaluator.cs index c40aaadf8cd..3796fbecae3 100644 --- a/src/Libraries/DSCPython/CPythonEvaluator.cs +++ b/src/Libraries/DSCPython/CPythonEvaluator.cs @@ -556,7 +556,9 @@ public override object OutputDataMarshaler } } // Special case for big long values: decode them as BigInteger - if (PyInt.IsIntType(pyObj)) + + var unmarshalled = pyObj.AsManagedObject(typeof(object)); + if (unmarshalled is PyInt) { using (var pyLong = PyInt.AsInt(pyObj)) { @@ -570,8 +572,8 @@ public override object OutputDataMarshaler } } } + // Default handling for other Python objects - var unmarshalled = pyObj.AsManagedObject(typeof(object)); if (unmarshalled is PyObject) { using (unmarshalled as PyObject)