Index: Modules/_sre.c =================================================================== --- Modules/_sre.c (révision 64939) +++ Modules/_sre.c (copie de travail) @@ -2698,7 +2698,7 @@ } if (PyErr_Occurred()) { - PyObject_DEL(self); + Py_DECREF(self); return NULL; } @@ -3243,7 +3243,7 @@ scanner_dealloc(ScannerObject* self) { state_fini(&self->state); - Py_DECREF(self->pattern); + Py_XDECREF(self->pattern); PyObject_DEL(self); } @@ -3365,10 +3365,11 @@ self = PyObject_NEW(ScannerObject, &Scanner_Type); if (!self) return NULL; + self->pattern = NULL; string = state_init(&self->state, pattern, string, start, end); if (!string) { - PyObject_DEL(self); + Py_DECREF(self); return NULL; }