Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 26c966b

Browse files
author
Victor Stinner
committed
Merged revisions 78664 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r78664 | victor.stinner | 2010-03-04 22:59:53 +0100 (jeu., 04 mars 2010) | 3 lines Issue #3299: replace PyObject_DEL() by Py_DECREF() in _sre module to fix a crash in pydebug mode. ........
1 parent 9fc2053 commit 26c966b

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_re.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ def test_dealloc(self):
706706
long_overflow = 2**128
707707
self.assertRaises(TypeError, re.finditer, "a", {})
708708
self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
709+
self.assertRaises(TypeError, _sre.compile, {}, 0, [])
709710

710711
def run_re_tests():
711712
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR

Modules/_sre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2702,7 +2702,7 @@ _compile(PyObject* self_, PyObject* args)
27022702
else {
27032703
Py_ssize_t p_length;
27042704
if (!getstring(pattern, &p_length, &self->charsize)) {
2705-
PyObject_DEL(self);
2705+
Py_DECREF(self);
27062706
return NULL;
27072707
}
27082708
}

0 commit comments

Comments
 (0)