mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_STR) (#125194)
Replace PyUnicode_New(0, 0), PyUnicode_FromString("") and PyUnicode_FromStringAndSize("", 0) with Py_GetConstant(Py_CONSTANT_EMPTY_STR).
This commit is contained in:
parent
6a39e96ab8
commit
b9a8ca0a6a
22 changed files with 35 additions and 35 deletions
|
@ -1287,7 +1287,7 @@ too_many_positional(PyThreadState *tstate, PyCodeObject *co,
|
|||
}
|
||||
else {
|
||||
/* This will not fail. */
|
||||
kwonly_sig = PyUnicode_FromString("");
|
||||
kwonly_sig = Py_GetConstant(Py_CONSTANT_EMPTY_STR);
|
||||
assert(kwonly_sig != NULL);
|
||||
}
|
||||
_PyErr_Format(tstate, PyExc_TypeError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue