summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-06 01:16:01 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-06 01:16:01 (GMT)
commit3466bde1cc113750450ffed028cc6fc7c95faedd (patch)
tree231febf716064e61b742a058c60da523c8b30fe3 /Python/bltinmodule.c
parentad8c83ad6b91bebbc124c0c36e67b9836ca3d90f (diff)
downloadcpython-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/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 07d59ca..be14560 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1784,7 +1784,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
if (do_flush == -1)
return NULL;
else if (do_flush) {
- tmp = _PyObject_CallMethodId(file, &PyId_flush, "");
+ tmp = _PyObject_CallMethodId(file, &PyId_flush, NULL);
if (tmp == NULL)
return NULL;
else
@@ -1850,7 +1850,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
}
/* First of all, flush stderr */
- tmp = _PyObject_CallMethodId(ferr, &PyId_flush, "");
+ tmp = _PyObject_CallMethodId(ferr, &PyId_flush, NULL);
if (tmp == NULL)
PyErr_Clear();
else
@@ -1859,7 +1859,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
/* We should only use (GNU) readline if Python's sys.stdin and
sys.stdout are the same as C's stdin and stdout, because we
need to pass it those. */
- tmp = _PyObject_CallMethodId(fin, &PyId_fileno, "");
+ tmp = _PyObject_CallMethodId(fin, &PyId_fileno, NULL);
if (tmp == NULL) {
PyErr_Clear();
tty = 0;
@@ -1872,7 +1872,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
tty = fd == fileno(stdin) && isatty(fd);
}
if (tty) {
- tmp = _PyObject_CallMethodId(fout, &PyId_fileno, "");
+ tmp = _PyObject_CallMethodId(fout, &PyId_fileno, NULL);
if (tmp == NULL) {
PyErr_Clear();
tty = 0;
@@ -1907,7 +1907,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
stdin_errors_str = _PyUnicode_AsString(stdin_errors);
if (!stdin_encoding_str || !stdin_errors_str)
goto _readline_errors;
- tmp = _PyObject_CallMethodId(fout, &PyId_flush, "");
+ tmp = _PyObject_CallMethodId(fout, &PyId_flush, NULL);
if (tmp == NULL)
PyErr_Clear();
else
@@ -1987,7 +1987,7 @@ builtin_input_impl(PyObject *module, PyObject *prompt)
if (PyFile_WriteObject(prompt, fout, Py_PRINT_RAW) != 0)
return NULL;
}
- tmp = _PyObject_CallMethodId(fout, &PyId_flush, "");
+ tmp = _PyObject_CallMethodId(fout, &PyId_flush, NULL);
if (tmp == NULL)
PyErr_Clear();
else