summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-11 00:43:56 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-11-11 00:43:56 (GMT)
commit0cae609847cccd78d3a960a70782c7b7ee891e3e (patch)
tree4a22d66df29665e7e30ed0e13055c301b68e80ea /Python/sysmodule.c
parent7255edd3df1ff5a69700089db40fedf997788c0a (diff)
downloadcpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.zip
cpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.tar.gz
cpython-0cae609847cccd78d3a960a70782c7b7ee891e3e.tar.bz2
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 e348b38..9247d4e 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 *