mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.11] gh-110590: Fix a bug where _sre.compile would overwrite exceptions (GH-110591) (#110614)
TypeError would be overwritten by OverflowError
if 'code' param contained non-ints.
(cherry picked from commit 344d3a222a
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
194272179d
commit
7fefed091a
3 changed files with 9 additions and 0 deletions
|
@ -2725,6 +2725,9 @@ class ImplementationTest(unittest.TestCase):
|
|||
_sre.compile("abc", 0, [long_overflow], 0, {}, ())
|
||||
with self.assertRaises(TypeError):
|
||||
_sre.compile({}, 0, [], 0, [], [])
|
||||
# gh-110590: `TypeError` was overwritten with `OverflowError`:
|
||||
with self.assertRaises(TypeError):
|
||||
_sre.compile('', 0, ['abc'], 0, {}, ())
|
||||
|
||||
@cpython_only
|
||||
def test_repeat_minmax_overflow_maxrepeat(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue