# Bug report ### Bug description: In the function `pylong_aslongandoverflow` https://github.com/python/cpython/blob/3929af5e3a203291dc07b40c9c3515492e3ba7b4/Modules/_testlimitedcapi/long.c#L621-L632 there is an assertion `overflow == -1` when `value == -1`. But this is not always true, like if `arg` is `NULL`. Reproduce: ```python from test.support import import_helper _testlimitedcapi = import_helper.import_module('_testlimitedcapi') aslonglongandoverflow = _testlimitedcapi.pylong_aslonglongandoverflow aslonglongandoverflow(None) ``` Result: ``` python: ../Modules/_testlimitedcapi/long.c:674: pylong_aslonglongandoverflow: Assertion `overflow == -1' failed. ``` ### CPython versions tested on: CPython main branch ### Operating systems tested on: Linux <!-- gh-linked-prs --> ### Linked PRs * gh-130828 * gh-130869 * gh-130871 * gh-130876 <!-- /gh-linked-prs -->
Bug report
Bug description:
In the function
pylong_aslongandoverflowcpython/Modules/_testlimitedcapi/long.c
Lines 621 to 632 in 3929af5
there is an assertion
overflow == -1whenvalue == -1. But this is not always true, like ifargisNULL.Reproduce:
Result:
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
NULLinPyLong_*AndOverflowfunctions #130828NULLinPyLong_*AndOverflowfunctions (GH-130828) #130869