summaryrefslogtreecommitdiff
path: root/Python/errors.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2015-01-22 17:53:24 -0800
committerGregory P. Smith <greg@krypto.org>2015-01-22 17:53:24 -0800
commitf96f55a3d0202f625ddb021e4768f39a08594b1b (patch)
tree5635e9e954272393a993fdaa3cf563e91f86f383 /Python/errors.c
parenta442c1f64b48e61b2c1e8f8e4cf56858f3e9221c (diff)
parent2e0399ab422ca2b0224c0bffcf7535c855789091 (diff)
downloadcpython-f96f55a3d0202f625ddb021e4768f39a08594b1b.tar.gz
Only pass -E to the child interpreter if our interpreter was running in that
mode. Explicitly remove the PYTHONFAULTHANDLER environment variable before launching a child interpreter when its presence would impact the test (the reason -E was being used in the first place). This enables running the test in an environment where other Python environment variables must be set in order for things to run (such as using PYTHONHOME to tell an embedded interpreter where it should think it lives).
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)