diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/_warnings.c | 4 | ||||
-rw-r--r-- | Python/compile.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index 12b1021..8ccd4bb 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -408,8 +408,10 @@ warn_explicit(PyObject *category, PyObject *message, /* A proper implementation of warnings.showwarning() should have at least two default arguments. */ if ((defaults == NULL) || (PyTuple_Size(defaults) < 2)) { - if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1) < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1) < 0) { + Py_DECREF(show_fxn); goto cleanup; + } } res = PyObject_CallFunctionObjArgs(show_fxn, message, category, filename, lineno_obj, diff --git a/Python/compile.c b/Python/compile.c index 94a2715..6cc5c4a 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -2984,7 +2984,7 @@ compiler_genexp(struct compiler *c, expr_ty e) { static identifier name; if (!name) { - name = PyUnicode_FromString("<genexp>"); + name = PyUnicode_FromString("<genexpr>"); if (!name) return 0; } |