Skip to content

bpo-39870: Remove unused arg from sys_displayhook_unencodable. #18796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2020
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ PyDoc_STRVAR(breakpointhook_doc,

Helper function for sys_displayhook(). */
static int
sys_displayhook_unencodable(PyThreadState *tstate, PyObject *outf, PyObject *o)
sys_displayhook_unencodable(PyObject *outf, PyObject *o)
{
PyObject *stdout_encoding = NULL;
PyObject *encoded, *escaped_str, *repr_str, *buffer, *result;
Expand Down Expand Up @@ -624,7 +624,6 @@ sys_displayhook(PyObject *module, PyObject *o)
PyObject *outf;
PyObject *builtins;
static PyObject *newline = NULL;
int err;
PyThreadState *tstate = _PyThreadState_GET();

builtins = _PyImport_GetModuleId(&PyId_builtins);
Expand Down Expand Up @@ -652,10 +651,11 @@ sys_displayhook(PyObject *module, PyObject *o)
}
if (PyFile_WriteObject(o, outf, 0) != 0) {
if (_PyErr_ExceptionMatches(tstate, PyExc_UnicodeEncodeError)) {
int err;
/* repr(o) is not encodable to sys.stdout.encoding with
* sys.stdout.errors error handler (which is probably 'strict') */
_PyErr_Clear(tstate);
err = sys_displayhook_unencodable(tstate, outf, o);
err = sys_displayhook_unencodable(outf, o);
if (err) {
return NULL;
}
Expand Down