mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Avoid calling functions with an empty string as format string
Directly pass NULL rather than an empty string.
This commit is contained in:
parent
ad8c83ad6b
commit
3466bde1cc
13 changed files with 34 additions and 34 deletions
|
@ -314,7 +314,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
|
|||
if (fob == NULL) {
|
||||
PyErr_Clear();
|
||||
|
||||
res = _PyObject_CallMethodId(binary, &PyId_close, "");
|
||||
res = _PyObject_CallMethodId(binary, &PyId_close, NULL);
|
||||
Py_DECREF(binary);
|
||||
if (res)
|
||||
Py_DECREF(res);
|
||||
|
@ -334,7 +334,7 @@ _Py_DisplaySourceLine(PyObject *f, PyObject *filename, int lineno, int indent)
|
|||
break;
|
||||
}
|
||||
}
|
||||
res = _PyObject_CallMethodId(fob, &PyId_close, "");
|
||||
res = _PyObject_CallMethodId(fob, &PyId_close, NULL);
|
||||
if (res)
|
||||
Py_DECREF(res);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue