public int GetExitCode(out object otherCode) { otherCode = null; object pyObj = PythonExceptions.ToPython(this); object args; PythonTuple t; if (!PythonOps.TryGetBoundAttr(pyObj, "args", out args) || (t = args as PythonTuple) == null || t.__len__() == 0) { return(0); } else if (Builtin.isinstance(t[0], TypeCache.Int32)) { return(Converter.ConvertToInt32(t[0])); } else if (Builtin.isinstance(t[0], TypeCache.BigInteger)) { var b = Converter.ConvertToBigInteger(t[0]); if (b > int.MaxValue || b < int.MinValue) { return(-1); } return((int)b); } otherCode = t[0]; return(1); }
public int GetExitCode(out object otherCode) { otherCode = null; object pyObj = PythonExceptions.ToPython(this); object args; PythonTuple t; if (!PythonOps.TryGetBoundAttr(pyObj, "args", out args) || (t = args as PythonTuple) == null || t.__len__() == 0) { return 0; } else if (Builtin.isinstance(t[0], TypeCache.Int32)) { return Converter.ConvertToInt32(t[0]); } otherCode = t[0]; return 1; }