mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Issue #20437: Fixed 22 potential bugs when deleting objects references.
This commit is contained in:
		
						commit
						dfe98a102e
					
				
					 15 changed files with 34 additions and 63 deletions
				
			
		| 
						 | 
					@ -10,6 +10,8 @@ Release date: 2014-02-09
 | 
				
			||||||
Core and Builtins
 | 
					Core and Builtins
 | 
				
			||||||
-----------------
 | 
					-----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Issue #20437: Fixed 22 potential bugs when deleting objects references.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Issue #20500: Displaying an exception at interpreter shutdown no longer
 | 
					- Issue #20500: Displaying an exception at interpreter shutdown no longer
 | 
				
			||||||
  risks triggering an assertion failure in PyObject_Str.
 | 
					  risks triggering an assertion failure in PyObject_Str.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -159,10 +159,8 @@ _DictRemover_call(PyObject *myself, PyObject *args, PyObject *kw)
 | 
				
			||||||
        if (-1 == PyDict_DelItem(self->dict, self->key))
 | 
					        if (-1 == PyDict_DelItem(self->dict, self->key))
 | 
				
			||||||
            /* XXX Error context */
 | 
					            /* XXX Error context */
 | 
				
			||||||
            PyErr_WriteUnraisable(Py_None);
 | 
					            PyErr_WriteUnraisable(Py_None);
 | 
				
			||||||
        Py_DECREF(self->key);
 | 
					        Py_CLEAR(self->key);
 | 
				
			||||||
        self->key = NULL;
 | 
					        Py_CLEAR(self->dict);
 | 
				
			||||||
        Py_DECREF(self->dict);
 | 
					 | 
				
			||||||
        self->dict = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Py_INCREF(Py_None);
 | 
					    Py_INCREF(Py_None);
 | 
				
			||||||
    return Py_None;
 | 
					    return Py_None;
 | 
				
			||||||
| 
						 | 
					@ -2934,10 +2932,8 @@ static int
 | 
				
			||||||
PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
 | 
					PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (ob == NULL) {
 | 
					    if (ob == NULL) {
 | 
				
			||||||
        Py_XDECREF(self->restype);
 | 
					        Py_CLEAR(self->restype);
 | 
				
			||||||
        self->restype = NULL;
 | 
					        Py_CLEAR(self->checker);
 | 
				
			||||||
        Py_XDECREF(self->checker);
 | 
					 | 
				
			||||||
        self->checker = NULL;
 | 
					 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
 | 
					    if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
 | 
				
			||||||
| 
						 | 
					@ -2980,10 +2976,8 @@ PyCFuncPtr_set_argtypes(PyCFuncPtrObject *self, PyObject *ob)
 | 
				
			||||||
    PyObject *converters;
 | 
					    PyObject *converters;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (ob == NULL || ob == Py_None) {
 | 
					    if (ob == NULL || ob == Py_None) {
 | 
				
			||||||
        Py_XDECREF(self->converters);
 | 
					        Py_CLEAR(self->converters);
 | 
				
			||||||
        self->converters = NULL;
 | 
					        Py_CLEAR(self->argtypes);
 | 
				
			||||||
        Py_XDECREF(self->argtypes);
 | 
					 | 
				
			||||||
        self->argtypes = NULL;
 | 
					 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        converters = converters_from_argtypes(ob);
 | 
					        converters = converters_from_argtypes(ob);
 | 
				
			||||||
        if (!converters)
 | 
					        if (!converters)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -229,8 +229,7 @@ int pysqlite_build_row_cast_map(pysqlite_Cursor* self)
 | 
				
			||||||
            if (converter != Py_None) {
 | 
					            if (converter != Py_None) {
 | 
				
			||||||
                Py_DECREF(converter);
 | 
					                Py_DECREF(converter);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            Py_XDECREF(self->row_cast_map);
 | 
					            Py_CLEAR(self->row_cast_map);
 | 
				
			||||||
            self->row_cast_map = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return -1;
 | 
					            return -1;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -447,8 +446,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
 | 
				
			||||||
    self->locked = 1;
 | 
					    self->locked = 1;
 | 
				
			||||||
    self->reset = 0;
 | 
					    self->reset = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_XDECREF(self->next_row);
 | 
					    Py_CLEAR(self->next_row);
 | 
				
			||||||
    self->next_row = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (multiple) {
 | 
					    if (multiple) {
 | 
				
			||||||
        /* executemany() */
 | 
					        /* executemany() */
 | 
				
			||||||
| 
						 | 
					@ -864,8 +862,7 @@ PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self)
 | 
				
			||||||
    if (!self->next_row) {
 | 
					    if (!self->next_row) {
 | 
				
			||||||
         if (self->statement) {
 | 
					         if (self->statement) {
 | 
				
			||||||
            (void)pysqlite_statement_reset(self->statement);
 | 
					            (void)pysqlite_statement_reset(self->statement);
 | 
				
			||||||
            Py_DECREF(self->statement);
 | 
					            Py_CLEAR(self->statement);
 | 
				
			||||||
            self->statement = NULL;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -780,8 +780,7 @@ typedef struct {
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
path_cleanup(path_t *path) {
 | 
					path_cleanup(path_t *path) {
 | 
				
			||||||
    if (path->cleanup) {
 | 
					    if (path->cleanup) {
 | 
				
			||||||
        Py_DECREF(path->cleanup);
 | 
					        Py_CLEAR(path->cleanup);
 | 
				
			||||||
        path->cleanup = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -317,8 +317,7 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args,
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        if (trace_frame(tstate, f, PyTrace_RETURN, res) < 0) {
 | 
					        if (trace_frame(tstate, f, PyTrace_RETURN, res) < 0) {
 | 
				
			||||||
            Py_XDECREF(res);
 | 
					            Py_CLEAR(res);
 | 
				
			||||||
            res = NULL;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -281,8 +281,7 @@ set_hook(const char *funcname, PyObject **hook_var, PyObject *args)
 | 
				
			||||||
    if (!PyArg_ParseTuple(args, buf, &function))
 | 
					    if (!PyArg_ParseTuple(args, buf, &function))
 | 
				
			||||||
        return NULL;
 | 
					        return NULL;
 | 
				
			||||||
    if (function == Py_None) {
 | 
					    if (function == Py_None) {
 | 
				
			||||||
        Py_XDECREF(*hook_var);
 | 
					        Py_CLEAR(*hook_var);
 | 
				
			||||||
        *hook_var = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else if (PyCallable_Check(function)) {
 | 
					    else if (PyCallable_Check(function)) {
 | 
				
			||||||
        PyObject *tmp = *hook_var;
 | 
					        PyObject *tmp = *hook_var;
 | 
				
			||||||
| 
						 | 
					@ -885,7 +884,7 @@ on_completion_display_matches_hook(char **matches,
 | 
				
			||||||
        (r != Py_None && PyLong_AsLong(r) == -1 && PyErr_Occurred())) {
 | 
					        (r != Py_None && PyLong_AsLong(r) == -1 && PyErr_Occurred())) {
 | 
				
			||||||
        goto error;
 | 
					        goto error;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Py_XDECREF(r); r=NULL;
 | 
					    Py_CLEAR(r);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (0) {
 | 
					    if (0) {
 | 
				
			||||||
    error:
 | 
					    error:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -66,8 +66,7 @@ reap_obj(pylist fd2obj[FD_SETSIZE + 1])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int i;
 | 
					    int i;
 | 
				
			||||||
    for (i = 0; i < FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) {
 | 
					    for (i = 0; i < FD_SETSIZE + 1 && fd2obj[i].sentinel >= 0; i++) {
 | 
				
			||||||
        Py_XDECREF(fd2obj[i].obj);
 | 
					        Py_CLEAR(fd2obj[i].obj);
 | 
				
			||||||
        fd2obj[i].obj = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    fd2obj[0].sentinel = -1;
 | 
					    fd2obj[0].sentinel = -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1305,12 +1305,9 @@ finisignal(void)
 | 
				
			||||||
        Py_XDECREF(func);
 | 
					        Py_XDECREF(func);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Py_XDECREF(IntHandler);
 | 
					    Py_CLEAR(IntHandler);
 | 
				
			||||||
    IntHandler = NULL;
 | 
					    Py_CLEAR(DefaultHandler);
 | 
				
			||||||
    Py_XDECREF(DefaultHandler);
 | 
					    Py_CLEAR(IgnoreHandler);
 | 
				
			||||||
    DefaultHandler = NULL;
 | 
					 | 
				
			||||||
    Py_XDECREF(IgnoreHandler);
 | 
					 | 
				
			||||||
    IgnoreHandler = NULL;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -197,8 +197,7 @@ syslog_closelog(PyObject *self, PyObject *unused)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (S_log_open) {
 | 
					    if (S_log_open) {
 | 
				
			||||||
        closelog();
 | 
					        closelog();
 | 
				
			||||||
        Py_XDECREF(S_ident_o);
 | 
					        Py_CLEAR(S_ident_o);
 | 
				
			||||||
        S_ident_o = NULL;
 | 
					 | 
				
			||||||
        S_log_open = 0;
 | 
					        S_log_open = 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    Py_INCREF(Py_None);
 | 
					    Py_INCREF(Py_None);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -463,8 +463,7 @@ zlib_compressobj_impl(PyModuleDef *module, int level, int method, int wbits, int
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 error:
 | 
					 error:
 | 
				
			||||||
    Py_XDECREF(self);
 | 
					    Py_CLEAR(self);
 | 
				
			||||||
    self = NULL;
 | 
					 | 
				
			||||||
 success:
 | 
					 success:
 | 
				
			||||||
    return (PyObject*)self;
 | 
					    return (PyObject*)self;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -879,8 +879,7 @@ _PyTuple_Resize(PyObject **pv, Py_ssize_t newsize)
 | 
				
			||||||
    _Py_ForgetReference((PyObject *) v);
 | 
					    _Py_ForgetReference((PyObject *) v);
 | 
				
			||||||
    /* DECREF items deleted by shrinkage */
 | 
					    /* DECREF items deleted by shrinkage */
 | 
				
			||||||
    for (i = newsize; i < oldsize; i++) {
 | 
					    for (i = newsize; i < oldsize; i++) {
 | 
				
			||||||
        Py_XDECREF(v->ob_item[i]);
 | 
					        Py_CLEAR(v->ob_item[i]);
 | 
				
			||||||
        v->ob_item[i] = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    sv = PyObject_GC_Resize(PyTupleObject, v, newsize);
 | 
					    sv = PyObject_GC_Resize(PyTupleObject, v, newsize);
 | 
				
			||||||
    if (sv == NULL) {
 | 
					    if (sv == NULL) {
 | 
				
			||||||
| 
						 | 
					@ -926,8 +925,7 @@ PyTuple_Fini(void)
 | 
				
			||||||
#if PyTuple_MAXSAVESIZE > 0
 | 
					#if PyTuple_MAXSAVESIZE > 0
 | 
				
			||||||
    /* empty tuples are used all over the place and applications may
 | 
					    /* empty tuples are used all over the place and applications may
 | 
				
			||||||
     * rely on the fact that an empty tuple is a singleton. */
 | 
					     * rely on the fact that an empty tuple is a singleton. */
 | 
				
			||||||
    Py_XDECREF(free_list[0]);
 | 
					    Py_CLEAR(free_list[0]);
 | 
				
			||||||
    free_list[0] = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (void)PyTuple_ClearFreeList();
 | 
					    (void)PyTuple_ClearFreeList();
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1902,8 +1902,7 @@ _PyUnicode_ClearStaticStrings()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    _Py_Identifier *tmp, *s = static_strings;
 | 
					    _Py_Identifier *tmp, *s = static_strings;
 | 
				
			||||||
    while (s) {
 | 
					    while (s) {
 | 
				
			||||||
        Py_DECREF(s->object);
 | 
					        Py_CLEAR(s->object);
 | 
				
			||||||
        s->object = NULL;
 | 
					 | 
				
			||||||
        tmp = s->next;
 | 
					        tmp = s->next;
 | 
				
			||||||
        s->next = NULL;
 | 
					        s->next = NULL;
 | 
				
			||||||
        s = tmp;
 | 
					        s = tmp;
 | 
				
			||||||
| 
						 | 
					@ -4005,8 +4004,7 @@ make_decode_exception(PyObject **exceptionObject,
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
onError:
 | 
					onError:
 | 
				
			||||||
    Py_DECREF(*exceptionObject);
 | 
					    Py_CLEAR(*exceptionObject);
 | 
				
			||||||
    *exceptionObject = NULL;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef HAVE_MBCS
 | 
					#ifdef HAVE_MBCS
 | 
				
			||||||
| 
						 | 
					@ -6366,8 +6364,7 @@ make_encode_exception(PyObject **exceptionObject,
 | 
				
			||||||
            goto onError;
 | 
					            goto onError;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
      onError:
 | 
					      onError:
 | 
				
			||||||
        Py_DECREF(*exceptionObject);
 | 
					        Py_CLEAR(*exceptionObject);
 | 
				
			||||||
        *exceptionObject = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8410,8 +8407,7 @@ make_translate_exception(PyObject **exceptionObject,
 | 
				
			||||||
            goto onError;
 | 
					            goto onError;
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
      onError:
 | 
					      onError:
 | 
				
			||||||
        Py_DECREF(*exceptionObject);
 | 
					        Py_CLEAR(*exceptionObject);
 | 
				
			||||||
        *exceptionObject = NULL;
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13502,8 +13498,7 @@ _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer)
 | 
				
			||||||
        PyObject *newbuffer;
 | 
					        PyObject *newbuffer;
 | 
				
			||||||
        newbuffer = resize_compact(writer->buffer, writer->pos);
 | 
					        newbuffer = resize_compact(writer->buffer, writer->pos);
 | 
				
			||||||
        if (newbuffer == NULL) {
 | 
					        if (newbuffer == NULL) {
 | 
				
			||||||
            Py_DECREF(writer->buffer);
 | 
					            Py_CLEAR(writer->buffer);
 | 
				
			||||||
            writer->buffer = NULL;
 | 
					 | 
				
			||||||
            return NULL;
 | 
					            return NULL;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        writer->buffer = newbuffer;
 | 
					        writer->buffer = newbuffer;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3189,8 +3189,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
 | 
				
			||||||
                if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
 | 
					                if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
 | 
				
			||||||
                               tstate, f,
 | 
					                               tstate, f,
 | 
				
			||||||
                               PyTrace_RETURN, retval)) {
 | 
					                               PyTrace_RETURN, retval)) {
 | 
				
			||||||
                    Py_XDECREF(retval);
 | 
					                    Py_CLEAR(retval);
 | 
				
			||||||
                    retval = NULL;
 | 
					 | 
				
			||||||
                    why = WHY_EXCEPTION;
 | 
					                    why = WHY_EXCEPTION;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -3209,8 +3208,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
 | 
				
			||||||
            else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
 | 
					            else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
 | 
				
			||||||
                                tstate, f,
 | 
					                                tstate, f,
 | 
				
			||||||
                                PyTrace_RETURN, retval)) {
 | 
					                                PyTrace_RETURN, retval)) {
 | 
				
			||||||
                Py_XDECREF(retval);
 | 
					                Py_CLEAR(retval);
 | 
				
			||||||
                retval = NULL;
 | 
					 | 
				
			||||||
                /* why = WHY_EXCEPTION; */
 | 
					                /* why = WHY_EXCEPTION; */
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -3568,8 +3566,7 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
 | 
				
			||||||
    if (co->co_flags & CO_GENERATOR) {
 | 
					    if (co->co_flags & CO_GENERATOR) {
 | 
				
			||||||
        /* Don't need to keep the reference to f_back, it will be set
 | 
					        /* Don't need to keep the reference to f_back, it will be set
 | 
				
			||||||
         * when the generator is resumed. */
 | 
					         * when the generator is resumed. */
 | 
				
			||||||
        Py_XDECREF(f->f_back);
 | 
					        Py_CLEAR(f->f_back);
 | 
				
			||||||
        f->f_back = NULL;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        PCALL(PCALL_GENERATOR);
 | 
					        PCALL(PCALL_GENERATOR);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -349,8 +349,7 @@ _imp_release_lock_impl(PyModuleDef *module)
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
_PyImport_Fini(void)
 | 
					_PyImport_Fini(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    Py_XDECREF(extensions);
 | 
					    Py_CLEAR(extensions);
 | 
				
			||||||
    extensions = NULL;
 | 
					 | 
				
			||||||
#ifdef WITH_THREAD
 | 
					#ifdef WITH_THREAD
 | 
				
			||||||
    if (import_lock != NULL) {
 | 
					    if (import_lock != NULL) {
 | 
				
			||||||
        PyThread_free_lock(import_lock);
 | 
					        PyThread_free_lock(import_lock);
 | 
				
			||||||
| 
						 | 
					@ -598,8 +597,7 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
 | 
				
			||||||
            /* Somebody already imported the module,
 | 
					            /* Somebody already imported the module,
 | 
				
			||||||
               likely under a different name.
 | 
					               likely under a different name.
 | 
				
			||||||
               XXX this should really not happen. */
 | 
					               XXX this should really not happen. */
 | 
				
			||||||
            Py_DECREF(def->m_base.m_copy);
 | 
					            Py_CLEAR(def->m_base.m_copy);
 | 
				
			||||||
            def->m_base.m_copy = NULL;
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        dict = PyModule_GetDict(mod);
 | 
					        dict = PyModule_GetDict(mod);
 | 
				
			||||||
        if (dict == NULL)
 | 
					        if (dict == NULL)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -430,8 +430,7 @@ trace_trampoline(PyObject *self, PyFrameObject *frame,
 | 
				
			||||||
    result = call_trampoline(callback, frame, what, arg);
 | 
					    result = call_trampoline(callback, frame, what, arg);
 | 
				
			||||||
    if (result == NULL) {
 | 
					    if (result == NULL) {
 | 
				
			||||||
        PyEval_SetTrace(NULL, NULL);
 | 
					        PyEval_SetTrace(NULL, NULL);
 | 
				
			||||||
        Py_XDECREF(frame->f_trace);
 | 
					        Py_CLEAR(frame->f_trace);
 | 
				
			||||||
        frame->f_trace = NULL;
 | 
					 | 
				
			||||||
        return -1;
 | 
					        return -1;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (result != Py_None) {
 | 
					    if (result != Py_None) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue