Skip to content

Commit 4e1e3e6

Browse files
committed
revert to PyLong_AsLongAndOverflow for easier overflow handling
1 parent 56f802e commit 4e1e3e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/bytesobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2828,7 +2828,8 @@ _PyBytes_FromSequence(PyObject *x)
28282828
bytes = Py_None;
28292829
goto done;
28302830
}
2831-
int value = PyLong_AsInt(items[i]);
2831+
int overflow;
2832+
long value = PyLong_AsLongAndOverflow(items[i], &overflow);
28322833
if (value == -1 && PyErr_Occurred()) {
28332834
goto error;
28342835
}

0 commit comments

Comments
 (0)