summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-11 01:43:56 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-11-11 01:43:56 +0100
commitbc2f49454c330a83373e1f00c3de717dad4070ef (patch)
tree7906a7fbec8c193de57c9abc8ab0f8001e881fae /Python/sysmodule.c
parent8f660d1ae6c38ca4fa6e3bdf15595dac1eebf01d (diff)
downloadcpython-bc2f49454c330a83373e1f00c3de717dad4070ef.tar.gz
Use PyThreadState_GET() in performance critical code
It seems like _PyThreadState_UncheckedGet() is not inlined as expected, even when using gcc -O3.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index e348b3873e..9247d4ed69 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1547,8 +1547,9 @@ error:
Py_XDECREF(name);
Py_XDECREF(value);
/* No return value, therefore clear error state if possible */
- if (_PyThreadState_UncheckedGet())
+ if (_PyThreadState_UncheckedGet()) {
PyErr_Clear();
+ }
}
PyObject *