diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 13:05:09 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-27 13:05:09 +0000 |
commit | d45d8652710e51576367db00b226b8465e6c5ce6 (patch) | |
tree | eeb12605abc98507852e82848382c2e739991708 /Modules/faulthandler.c | |
parent | 6ccbbb38caa79f9eb9b93b5767f3787fc80cbac1 (diff) | |
parent | bbbab3c96168cea9f872f90da0a385b50f62ca70 (diff) | |
download | cpython-d45d8652710e51576367db00b226b8465e6c5ce6.tar.gz |
Closes #28784: Merged update from 3.6.
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r-- | Modules/faulthandler.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c index 1c1e4fb7d1..4fc8ebd4e3 100644 --- a/Modules/faulthandler.c +++ b/Modules/faulthandler.c @@ -521,12 +521,10 @@ static PyObject* faulthandler_disable_py(PyObject *self) { if (!fatal_error.enabled) { - Py_INCREF(Py_False); - return Py_False; + Py_RETURN_FALSE; } faulthandler_disable(); - Py_INCREF(Py_True); - return Py_True; + Py_RETURN_TRUE; } static PyObject* @@ -980,12 +978,21 @@ faulthandler_sigsegv(PyObject *self, PyObject *args) static void faulthandler_fatal_error_thread(void *plock) { +#ifndef __clang__ PyThread_type_lock *lock = (PyThread_type_lock *)plock; +#endif Py_FatalError("in new thread"); +#ifndef __clang__ + /* Issue #28152: Py_FatalError() is declared with + __attribute__((__noreturn__)). GCC emits a warning without + "PyThread_release_lock()" (compiler bug?), but Clang is smarter and + emits a warning on the return. */ + /* notify the caller that we are done */ PyThread_release_lock(lock); +#endif } static PyObject * |