Skip to content

Commit

Permalink
Drop PyLong_Check (which checked for exact type) in favour of PyInt_C…
Browse files Browse the repository at this point in the history
…heck (which checks for subtype)
  • Loading branch information
filmor committed Sep 19, 2022
1 parent a02799d commit 2194d6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/runtime/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ internal static bool ToPrimitive(BorrowedReference value, Type obType, out objec
{
if (Runtime.Is32Bit)
{
if (!Runtime.PyLong_Check(value))
if (!Runtime.PyInt_Check(value))
{
goto type_error;
}
Expand Down
5 changes: 0 additions & 5 deletions src/runtime/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,11 +1101,6 @@ internal static bool PyBool_Check(BorrowedReference ob)

internal static NewReference PyInt_FromInt64(long value) => PyLong_FromLongLong(value);

internal static bool PyLong_Check(BorrowedReference ob)
{
return PyObject_TYPE(ob) == PyLongType;
}

internal static NewReference PyLong_FromLongLong(long value) => Delegates.PyLong_FromLongLong(value);


Expand Down

0 comments on commit 2194d6c

Please sign in to comment.