-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
gh-143050: correct PyLong_FromString() to use _PyLong_Negate() #145901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fbcec5a
b8333ba
20e79c6
413e56d
b892216
78c5b4b
69d35bd
2f927e0
53523de
1f363f4
41961ed
0b29e28
45b3b04
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -803,6 +803,16 @@ def to_digits(num): | |
| self.assertEqual(pylongwriter_create(negative, digits), num, | ||
| (negative, digits)) | ||
|
|
||
| def test_bug_143050(self): | ||
| with support.adjust_int_max_str_digits(0): | ||
| # Bug coming from using _pylong.int_from_string(), that | ||
| # currently requires > 6000 decimal digits. | ||
| int('-' + '0' * 7000, 10) | ||
skirpichev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _testcapi.test_immortal_small_ints() | ||
| # Test also nonzero small int | ||
| int('-' + '0' * 7000 + '123', 10) | ||
skirpichev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| _testcapi.test_immortal_small_ints() | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's okay as long as it catches the regression in a debug build.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. _testcapi is always built with assertions, even in release mode.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I built Python in release mode without |
||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
Uh oh!
There was an error while loading. Please reload this page.