From 2b455a7283121aacb59804f29ecbf6fcde0fcadb Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Wed, 18 Sep 2024 10:41:23 +0300 Subject: [PATCH] +1 --- src/pythoncapi_compat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pythoncapi_compat.h b/src/pythoncapi_compat.h index 400c8ccd..5f14df8e 100644 --- a/src/pythoncapi_compat.h +++ b/src/pythoncapi_compat.h @@ -1268,7 +1268,7 @@ PyLong_Export(PyObject *obj, PyLongExport *export_long) int overflow; long value = PyLong_AsLongAndOverflow(obj, &overflow); - if ((size_t)bytes <= sizeof(value)) { + if (!overflow) { export_long->value = value; export_long->negative = 0; export_long->ndigits = 0;