Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change name
  • Loading branch information
Eclips4 committed May 15, 2024
commit f6da0053208134fbfedda471bd173d8759c446f7
2 changes: 1 addition & 1 deletion Lib/test/test_capi/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_warn_with_stacklevel(self):
import _testcapi

def foo():
_testcapi.test_warn()
_testcapi.function_set_warning()

foo() # line 6

Expand Down
4 changes: 2 additions & 2 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3304,7 +3304,7 @@ test_reftracer(PyObject *ob, PyObject *Py_UNUSED(ignored))
}

static PyObject *
test_warn(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
function_set_warning(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
{
if (PyErr_WarnEx(PyExc_RuntimeWarning, "Testing PyErr_WarnEx", 2)) {
return NULL;
Expand Down Expand Up @@ -3453,7 +3453,7 @@ static PyMethodDef TestMethods[] = {
{"function_set_closure", function_set_closure, METH_VARARGS, NULL},
{"check_pyimport_addmodule", check_pyimport_addmodule, METH_VARARGS},
{"test_weakref_capi", test_weakref_capi, METH_NOARGS},
{"test_warn", test_warn, METH_NOARGS},
{"function_set_warning", function_set_warning, METH_NOARGS},
{NULL, NULL} /* sentinel */
};

Expand Down