_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):
for (i = 0; i < n; i++) {
PyObject *o = PyList_GET_ITEM(code, i);
unsigned long value = PyLong_AsUnsignedLong(o);
+ if (value == (unsigned long)-1 && PyErr_Occurred()) {
+ break;
+ }
self->code[i] = (SRE_CODE) value;
if ((unsigned long) self->code[i] != value) {
PyErr_SetString(PyExc_OverflowError,