These pygi_pyerr_format calls end up stringifying the 'number' object with PyObject_Str(), but since https://github.com/python/cpython/commit/8e478327 it is considered invalid to call PyObject_Str() with the exception indicator set, and Python builds where Py_DEBUG is defined will fail an assertion if it is. We are about to set a different exception anyway, so clearing the exception indicator here is harmless.
This fixes build-time test failures when PyGObject is built against Debian's python3.?-dbg interpreters, which are built with Py_DEBUG defined.
Signed-off-by: Simon McVittie email@example.com