diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-03-16 12:45:27 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-03-16 12:45:27 -0500 |
commit | a72a90257a8f99f462cdaa0143a13b3f278e1b80 (patch) | |
tree | f4eb05c5d4ee5c213e0a8810cc91fbba4b611c31 /Python/errors.c | |
parent | 766b735986db096be23b645c89230324d0adbe2c (diff) | |
parent | 2aa107ce05f03db73620ed5e56a372948f856c44 (diff) | |
download | cpython-a72a90257a8f99f462cdaa0143a13b3f278e1b80.tar.gz |
merge 3.4 (#23679)
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Python/errors.c b/Python/errors.c index a980481110..940aef33a2 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -773,19 +773,11 @@ PyErr_BadInternalCall(void) #define PyErr_BadInternalCall() _PyErr_BadInternalCall(__FILE__, __LINE__) - PyObject * -PyErr_Format(PyObject *exception, const char *format, ...) +PyErr_FormatV(PyObject *exception, const char *format, va_list vargs) { - va_list vargs; PyObject* string; -#ifdef HAVE_STDARG_PROTOTYPES - va_start(vargs, format); -#else - va_start(vargs); -#endif - #ifdef Py_DEBUG /* in debug mode, PyEval_EvalFrameEx() fails with an assertion error if an exception is set when it is called */ @@ -795,11 +787,24 @@ PyErr_Format(PyObject *exception, const char *format, ...) string = PyUnicode_FromFormatV(format, vargs); PyErr_SetObject(exception, string); Py_XDECREF(string); - va_end(vargs); return NULL; } +PyObject * +PyErr_Format(PyObject *exception, const char *format, ...) +{ + va_list vargs; +#ifdef HAVE_STDARG_PROTOTYPES + va_start(vargs, format); +#else + va_start(vargs); +#endif + PyErr_FormatV(exception, format, vargs); + va_end(vargs); + return NULL; +} + PyObject * PyErr_NewException(const char *name, PyObject *base, PyObject *dict) |