Skip to content

Commit 7f8d1af

Browse files
committed
PEP7 + missing decref
1 parent c4a27bc commit 7f8d1af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Python/_warnings.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,18 +1369,20 @@ PyErr_WarnExplicitObject(PyObject *category, PyObject *message,
13691369
/* Like PyErr_WarnExplicitObject, but automatically sets up context */
13701370
int
13711371
_PyErr_WarnExplicitObjectWithContext(PyObject *category, PyObject *message,
1372-
PyObject *filename, int lineno)
1372+
PyObject *filename, int lineno)
13731373
{
13741374
PyObject *unused_filename, *module, *registry;
13751375
int unused_lineno;
13761376
int stack_level = 1;
13771377

13781378
if (!setup_context(stack_level, NULL, &unused_filename, &unused_lineno,
1379-
&module, &registry))
1379+
&module, &registry)) {
13801380
return -1;
1381+
}
13811382

13821383
int rc = PyErr_WarnExplicitObject(category, message, filename, lineno,
13831384
module, registry);
1385+
Py_DECREF(unused_filename);
13841386
Py_DECREF(module);
13851387
return rc;
13861388
}

0 commit comments

Comments
 (0)