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; }