Skip to content

Commit 4ea203f

Browse files
committed
cosmetics
1 parent 91df637 commit 4ea203f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Python/codecs.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -708,15 +708,12 @@ _PyCodec_IgnoreError(PyObject *exc, int as_bytes)
708708

709709
PyObject *PyCodec_IgnoreErrors(PyObject *exc)
710710
{
711-
if (_PyIsUnicodeEncodeError(exc)) {
711+
if (_PyIsUnicodeEncodeError(exc) || _PyIsUnicodeTranslateError(exc)) {
712712
return _PyCodec_IgnoreError(exc, false);
713713
}
714714
else if (_PyIsUnicodeDecodeError(exc)) {
715715
return _PyCodec_IgnoreError(exc, true);
716716
}
717-
else if (_PyIsUnicodeTranslateError(exc)) {
718-
return _PyCodec_IgnoreError(exc, false);
719-
}
720717
else {
721718
wrong_exception_type(exc);
722719
return NULL;
@@ -1394,7 +1391,8 @@ PyCodec_SurrogateEscapeErrors(PyObject *exc)
13941391

13951392
// --- Codecs registry handlers -----------------------------------------------
13961393

1397-
static PyObject *strict_errors(PyObject *self, PyObject *exc)
1394+
static inline PyObject *
1395+
strict_errors(PyObject *Py_UNUSED(self), PyObject *exc)
13981396
{
13991397
return PyCodec_StrictErrors(exc);
14001398
}

0 commit comments

Comments
 (0)