diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2016-05-27 12:56:41 -0600 |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2016-05-27 12:56:41 -0600 |
commit | 1f1268c0bc93629b7abc16d8af9cf997c32a947b (patch) | |
tree | 39ee4dfe533b80ba355fc850ca5de5bc85c09ec0 /Python/sysmodule.c | |
parent | f9990315cdea1d35808ed89f11a4fe388944553e (diff) | |
parent | 3bd347c543f3849bc5c70f7c07aa02bb204d3060 (diff) | |
download | cpython-1f1268c0bc93629b7abc16d8af9cf997c32a947b.tar.gz |
Issue #27138: Fix the doc comment for FileFinder.find_spec().
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 8d7e05a465..b5199125a5 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -20,6 +20,7 @@ Data members: #include "pythread.h" #include "osdefs.h" +#include <locale.h> #ifdef MS_WINDOWS #define WIN32_LEAN_AND_MEAN @@ -33,7 +34,6 @@ extern const char *PyWin_DLLVersionString; #endif #ifdef HAVE_LANGINFO_H -#include <locale.h> #include <langinfo.h> #endif @@ -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_XSETREF(frame->f_trace, result); } else { Py_DECREF(result); @@ -1152,8 +1151,10 @@ static PyObject * sys_debugmallocstats(PyObject *self, PyObject *args) { #ifdef WITH_PYMALLOC - _PyObject_DebugMallocStats(stderr); - fputc('\n', stderr); + if (_PyMem_PymallocEnabled()) { + _PyObject_DebugMallocStats(stderr); + fputc('\n', stderr); + } #endif _PyObject_DebugTypeStats(stderr); @@ -1643,15 +1644,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 |