summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-01-20 11:19:46 +0100
committerVictor Stinner <victor.stinner@gmail.com>2016-01-20 11:19:46 +0100
commitdfffc79da812f34d217192badef21ab3e3d5c04e (patch)
treeffdda55faeea98c2e5c74f59910326e0fa705034 /Python/sysmodule.c
parentb3b0102d41c7b1a25493b51d5d83d080fb32735b (diff)
parent804b0d51bab81cef3136c22a5d090bec595cb869 (diff)
downloadcpython-dfffc79da812f34d217192badef21ab3e3d5c04e.tar.gz
Merge 3.5
Issue #26154: Add a new private _PyThreadState_UncheckedGet() function.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8d7e05a465..702e8f0f9f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -346,8 +346,10 @@ static PyObject *whatstrings[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
static int
trace_init(void)
{
- static char *whatnames[7] = {"call", "exception", "line", "return",
- "c_call", "c_exception", "c_return"};
+ static const char * const whatnames[7] = {
+ "call", "exception", "line", "return",
+ "c_call", "c_exception", "c_return"
+ };
PyObject *name;
int i;
for (i = 0; i < 7; ++i) {
@@ -434,10 +436,7 @@ trace_trampoline(PyObject *self, PyFrameObject *frame,
return -1;
}
if (result != Py_None) {
- PyObject *temp = frame->f_trace;
- frame->f_trace = NULL;
- Py_XDECREF(temp);
- frame->f_trace = result;
+ Py_SETREF(frame->f_trace, result);
}
else {
Py_DECREF(result);
@@ -1643,15 +1642,11 @@ make_version_info(void)
/* sys.implementation values */
#define NAME "cpython"
const char *_PySys_ImplName = NAME;
-#define QUOTE(arg) #arg
-#define STRIFY(name) QUOTE(name)
-#define MAJOR STRIFY(PY_MAJOR_VERSION)
-#define MINOR STRIFY(PY_MINOR_VERSION)
+#define MAJOR Py_STRINGIFY(PY_MAJOR_VERSION)
+#define MINOR Py_STRINGIFY(PY_MINOR_VERSION)
#define TAG NAME "-" MAJOR MINOR
const char *_PySys_ImplCacheTag = TAG;
#undef NAME
-#undef QUOTE
-#undef STRIFY
#undef MAJOR
#undef MINOR
#undef TAG