Skip to content

Commit 2194d6c

Browse files
committed
Drop PyLong_Check (which checked for exact type) in favour of PyInt_Check (which checks for subtype)
1 parent a02799d commit 2194d6c

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/runtime/Converter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ internal static bool ToPrimitive(BorrowedReference value, Type obType, out objec
710710
{
711711
if (Runtime.Is32Bit)
712712
{
713-
if (!Runtime.PyLong_Check(value))
713+
if (!Runtime.PyInt_Check(value))
714714
{
715715
goto type_error;
716716
}

src/runtime/Runtime.cs

-5
Original file line numberDiff line numberDiff line change
@@ -1101,11 +1101,6 @@ internal static bool PyBool_Check(BorrowedReference ob)
11011101

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

1104-
internal static bool PyLong_Check(BorrowedReference ob)
1105-
{
1106-
return PyObject_TYPE(ob) == PyLongType;
1107-
}
1108-
11091104
internal static NewReference PyLong_FromLongLong(long value) => Delegates.PyLong_FromLongLong(value);
11101105

11111106

0 commit comments

Comments
 (0)