diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-03 09:30:51 +0200 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-03 09:30:51 +0200 |
| commit | f8bf9e370f256d0c50127046a6aa9cb9172bb83c (patch) | |
| tree | 49a77747ca6a66ba6be2ca033a69c2a2c0a8e74e /Python/errors.c | |
| parent | 1b9e42530b6406252fdbab73ab52dbf9e51a3421 (diff) | |
| parent | ee72ac6e35df0db14bfc93642b2f326266d897ae (diff) | |
| download | cpython-f8bf9e370f256d0c50127046a6aa9cb9172bb83c.tar.gz | |
Issue #23099: Closing io.BytesIO with exported buffer is rejected now to
prevent corrupting exported buffer.
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) |
