@@ -661,7 +661,7 @@ PyObject *PyCodec_LookupError(const char *name)
661661
662662
663663static inline void
664- unsupported_unicode_error_type (PyObject * exc )
664+ wrong_exception_type (PyObject * exc )
665665{
666666 PyErr_Format (PyExc_TypeError ,
667667 "don't know how to handle %T in error callback" ,
@@ -718,7 +718,7 @@ PyObject *PyCodec_IgnoreErrors(PyObject *exc)
718718 return _PyCodec_IgnoreError (exc , false);
719719 }
720720 else {
721- unsupported_unicode_error_type (exc );
721+ wrong_exception_type (exc );
722722 return NULL ;
723723 }
724724}
@@ -770,15 +770,15 @@ PyObject *PyCodec_ReplaceErrors(PyObject *exc)
770770 return Py_BuildValue ("(Nn)" , res , end );
771771 }
772772 else {
773- unsupported_unicode_error_type (exc );
773+ wrong_exception_type (exc );
774774 return NULL ;
775775 }
776776}
777777
778778PyObject * PyCodec_XMLCharRefReplaceErrors (PyObject * exc )
779779{
780780 if (!PyObject_TypeCheck (exc , (PyTypeObject * )PyExc_UnicodeEncodeError )) {
781- unsupported_unicode_error_type (exc );
781+ wrong_exception_type (exc );
782782 return NULL ;
783783 }
784784
@@ -928,7 +928,7 @@ PyObject *PyCodec_BackslashReplaceErrors(PyObject *exc)
928928 }
929929 }
930930 else {
931- unsupported_unicode_error_type (exc );
931+ wrong_exception_type (exc );
932932 return NULL ;
933933 }
934934
@@ -1077,7 +1077,7 @@ PyObject *PyCodec_NameReplaceErrors(PyObject *exc)
10771077 return restuple ;
10781078 }
10791079 else {
1080- unsupported_unicode_error_type (exc );
1080+ wrong_exception_type (exc );
10811081 return NULL ;
10821082 }
10831083}
@@ -1309,7 +1309,7 @@ PyCodec_SurrogatePassErrors(PyObject *exc)
13091309 return Py_BuildValue ("(Nn)" , res , start + bytelength );
13101310 }
13111311 else {
1312- unsupported_unicode_error_type (exc );
1312+ wrong_exception_type (exc );
13131313 return NULL ;
13141314 }
13151315}
@@ -1386,7 +1386,7 @@ PyCodec_SurrogateEscapeErrors(PyObject *exc)
13861386 return Py_BuildValue ("(Nn)" , str , start + consumed );
13871387 }
13881388 else {
1389- unsupported_unicode_error_type (exc );
1389+ wrong_exception_type (exc );
13901390 return NULL ;
13911391 }
13921392}
0 commit comments