summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-02 19:22:02 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-02 19:22:02 +0200
commit639102584ac9ace80edd54e1ea1a33dee08061ff (patch)
treea3b7dad6e9e03321f4323ebaf1e23ea4e5bce1ac /Python/errors.c
parent4a78f3673027e78881c7c930c924e74687bd24fa (diff)
parent57b61022a5189471af8cb72ab5b0cf85b4a6e1c1 (diff)
downloadcpython-639102584ac9ace80edd54e1ea1a33dee08061ff.tar.gz
Issue #22388: Unified the style of "Contributed by" sentences in What's New.
Diffstat (limited to 'Python/errors.c')
-rw-r--r--Python/errors.c25
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)