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)