Skip to content

Commit ec95008

Browse files
committed
fix: py3.13 and 3.14
1 parent 6a8a83c commit ec95008

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mypyc/lib-rt/int_ops.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,11 @@ PyObject *CPyLong_ToBytes(PyObject *v, Py_ssize_t length, const char *byteorder,
624624
PyErr_SetString(PyExc_ValueError, "byteorder must be either 'little' or 'big'");
625625
return NULL;
626626
}
627+
#if PY_VERSION_HEX >= 0x030D0000 // 3.13.0
628+
int res = _PyLong_AsByteArray((PyLongObject *)v, bytes, length, little_endian, signed_flag, 1);
629+
#else
627630
int res = _PyLong_AsByteArray((PyLongObject *)v, bytes, length, little_endian, signed_flag);
631+
#endif
628632
if (res < 0) {
629633
PyMem_Free(bytes);
630634
return NULL;

0 commit comments

Comments
 (0)