diff options
author | Gregory P. Smith <greg@krypto.org> | 2015-01-22 14:38:26 -0800 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2015-01-22 14:38:26 -0800 |
commit | 15237ce46d29a4ecc0c4b7d54d4a33340bbf2cfa (patch) | |
tree | 00b924fa607789e4b08669c41b88b20a0ee9b476 /Python/errors.c | |
parent | ac8adf7ce1ae1c28026e93f4f152cef61a3c8d6d (diff) | |
parent | 76877c2a5eecd93c16f8fe1dc514f76dd0668ba8 (diff) | |
download | cpython-15237ce46d29a4ecc0c4b7d54d4a33340bbf2cfa.tar.gz |
Break up TestCommandLine.test_env_var into four distinct tests.
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) |