summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-10-23 00:51:50 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-10-23 00:51:50 (GMT)
commit6fa627578a52bda0efee1619ddbadf6be0aa6591 (patch)
tree7d711a5c37204aa2abd711608d3854d784b49b1d /Objects
parente5567ad236958d32d901bf263fe198bf49cfde1a (diff)
downloadcpython-6fa627578a52bda0efee1619ddbadf6be0aa6591.zip
cpython-6fa627578a52bda0efee1619ddbadf6be0aa6591.tar.gz
cpython-6fa627578a52bda0efee1619ddbadf6be0aa6591.tar.bz2
Inline raise_translate_exception(): it is only used once
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index f569a83..362f2cf 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -8064,19 +8064,6 @@ make_translate_exception(PyObject **exceptionObject,
}
}
-/* raises a UnicodeTranslateError */
-static void
-raise_translate_exception(PyObject **exceptionObject,
- PyObject *unicode,
- Py_ssize_t startpos, Py_ssize_t endpos,
- const char *reason)
-{
- make_translate_exception(exceptionObject,
- unicode, startpos, endpos, reason);
- if (*exceptionObject != NULL)
- PyCodec_StrictErrors(*exceptionObject);
-}
-
/* error handling callback helper:
build arguments, call the callback and check the arguments,
put the result into newpos and return the replacement string, which
@@ -8352,8 +8339,10 @@ _PyUnicode_TranslateCharmap(PyObject *input,
}
switch (known_errorHandler) {
case 1: /* strict */
- raise_translate_exception(&exc, input, collstart,
- collend, reason);
+ make_translate_exception(&exc,
+ input, collstart, collend, reason);
+ if (exc != NULL)
+ PyCodec_StrictErrors(exc);
goto onError;
case 2: /* replace */
/* No need to check for space, this is a 1:1 replacement */