diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-21 23:40:19 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-21 23:40:19 +0100 |
commit | c044b71c5a4088125ba4ed2d2ac91d6497f08214 (patch) | |
tree | 92e5eafdb3133148a3bbdf311e11ab043046e352 /Python/errors.c | |
parent | 85bcea4803b60843dea7b454e994a6f60104acb1 (diff) | |
parent | e34216e38d78d9f9f3bf9ccd390d4c05ce8e9106 (diff) | |
download | cpython-c044b71c5a4088125ba4ed2d2ac91d6497f08214.tar.gz |
Merge 3.4 (asyncio)
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) |