diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-06 01:16:01 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-06 01:16:01 (GMT) |
commit | 3466bde1cc113750450ffed028cc6fc7c95faedd (patch) | |
tree | 231febf716064e61b742a058c60da523c8b30fe3 /Python/pylifecycle.c | |
parent | ad8c83ad6b91bebbc124c0c36e67b9836ca3d90f (diff) | |
download | cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.zip cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.gz cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.bz2 |
Avoid calling functions with an empty string as format string
Directly pass NULL rather than an empty string.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 004feae..1896888 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -493,7 +493,7 @@ flush_std_files(void) int status = 0; if (fout != NULL && fout != Py_None && !file_is_closed(fout)) { - tmp = _PyObject_CallMethodId(fout, &PyId_flush, ""); + tmp = _PyObject_CallMethodId(fout, &PyId_flush, NULL); if (tmp == NULL) { PyErr_WriteUnraisable(fout); status = -1; @@ -503,7 +503,7 @@ flush_std_files(void) } if (ferr != NULL && ferr != Py_None && !file_is_closed(ferr)) { - tmp = _PyObject_CallMethodId(ferr, &PyId_flush, ""); + tmp = _PyObject_CallMethodId(ferr, &PyId_flush, NULL); if (tmp == NULL) { PyErr_Clear(); status = -1; @@ -1072,7 +1072,7 @@ create_stdio(PyObject* io, text = PyUnicode_FromString(name); if (text == NULL || _PyObject_SetAttrId(raw, &PyId_name, text) < 0) goto error; - res = _PyObject_CallMethodId(raw, &PyId_isatty, ""); + res = _PyObject_CallMethodId(raw, &PyId_isatty, NULL); if (res == NULL) goto error; isatty = PyObject_IsTrue(res); @@ -1343,7 +1343,7 @@ _Py_FatalError_PrintExc(int fd) Py_XDECREF(tb); /* sys.stderr may be buffered: call sys.stderr.flush() */ - res = _PyObject_CallMethodId(ferr, &PyId_flush, ""); + res = _PyObject_CallMethodId(ferr, &PyId_flush, NULL); if (res == NULL) PyErr_Clear(); else @@ -1453,7 +1453,7 @@ wait_for_thread_shutdown(void) PyErr_Clear(); return; } - result = _PyObject_CallMethodId(threading, &PyId__shutdown, ""); + result = _PyObject_CallMethodId(threading, &PyId__shutdown, NULL); if (result == NULL) { PyErr_WriteUnraisable(threading); } |