Skip to content

Commit 3dde784

Browse files
committed
Whitespace converter.cs
1 parent eb9465a commit 3dde784

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

src/runtime/converter.cs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ internal static IntPtr GetPythonTypeByAlias(Type op)
8585
#if PYTHON3
8686
else if ((op == int16Type) ||
8787
(op == int32Type) ||
88-
(op == int64Type)) {
88+
(op == int64Type))
89+
{
8990
return Runtime.PyIntType;
9091
}
9192
#endif
@@ -465,29 +466,29 @@ static bool ToPrimitive(IntPtr value, Type obType, out Object result, bool setEr
465466
#elif PYTHON3 // When using Python3 always use the PyLong API
466467
{
467468
#endif
468-
op = Runtime.PyNumber_Long(value);
469-
if (op == IntPtr.Zero)
470-
{
471-
Exceptions.Clear();
472-
if (Exceptions.ExceptionMatches(overflow))
469+
op = Runtime.PyNumber_Long(value);
470+
if (op == IntPtr.Zero)
471+
{
472+
Exceptions.Clear();
473+
if (Exceptions.ExceptionMatches(overflow))
474+
{
475+
goto overflow;
476+
}
477+
goto type_error;
478+
}
479+
long ll = (long)Runtime.PyLong_AsLongLong(op);
480+
Runtime.XDecref(op);
481+
if ((ll == -1) && Exceptions.ErrorOccurred())
473482
{
474483
goto overflow;
475484
}
476-
goto type_error;
477-
}
478-
long ll = (long)Runtime.PyLong_AsLongLong(op);
479-
Runtime.XDecref(op);
480-
if ((ll == -1) && Exceptions.ErrorOccurred())
481-
{
482-
goto overflow;
483-
}
484-
if (ll > Int32.MaxValue || ll < Int32.MinValue)
485-
{
486-
goto overflow;
485+
if (ll > Int32.MaxValue || ll < Int32.MinValue)
486+
{
487+
goto overflow;
488+
}
489+
result = (int)ll;
490+
return true;
487491
}
488-
result = (int)ll;
489-
return true;
490-
}
491492

492493
case TypeCode.Boolean:
493494
result = (Runtime.PyObject_IsTrue(value) != 0);

0 commit comments

Comments
 (0)