diff options
Diffstat (limited to 'Python/sysmodule.c')
| -rw-r--r-- | Python/sysmodule.c | 19 | 
1 files changed, 7 insertions, 12 deletions
| diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 334f5d0..53dd4a1 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 | 
