[3.13] gh-143050: Correct PyLong_FromString() to use _PyLong_Negate() (#145901) (#147437)
The long_from_string_base() might return a small integer, when the _pylong.py is used to do conversion. Hence, we must be careful here to not smash it "small int" bit by using the _PyLong_FlipSign(). Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit db5936c5b89aa19e04d63120e0cf5bbc73bf2420) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
V
Victor Stinner committed
01af34a3649b34eb2b5e43ccbd106a8a88d9fc47
Parent: fc1c644
Committed by GitHub <noreply@github.com>
on 3/31/2026, 3:06:38 PM