Skip to content

Commit 7dd0e1e

Browse files
committed
One more fine point of error handling in the C extension.
1 parent 2bd0c5b commit 7dd0e1e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

coverage/tracer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ Tracer_init(Tracer *self, PyObject *args, PyObject *kwds)
138138
self->data_stack = PyMem_Malloc(STACK_DELTA*sizeof(DataStackEntry));
139139
if (self->data_stack == NULL) {
140140
STATS( self->stats.errors++; )
141+
PyErr_NoMemory();
141142
return -1;
142143
}
143144
self->data_stack_alloc = STACK_DELTA;
@@ -301,6 +302,7 @@ Tracer_trace(Tracer *self, PyFrameObject *frame, int what, PyObject *arg)
301302
DataStackEntry * bigger_data_stack = PyMem_Realloc(self->data_stack, bigger * sizeof(DataStackEntry));
302303
if (bigger_data_stack == NULL) {
303304
STATS( self->stats.errors++; )
305+
PyErr_NoMemory();
304306
self->depth--;
305307
return -1;
306308
}

0 commit comments

Comments
 (0)