summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-10-09 15:15:23 (GMT)
committerGitHub <noreply@github.com>2024-10-09 15:15:23 (GMT)
commitb9a8ca0a6aa9251cb798f34f0c9d2cc95107eec6 (patch)
tree570ffb9eae19501a3a173fab2dbf56490d1f83db /Python/ceval.c
parent6a39e96ab8ebc1144f713988ac6fe439e4476488 (diff)
downloadcpython-b9a8ca0a6aa9251cb798f34f0c9d2cc95107eec6.zip
cpython-b9a8ca0a6aa9251cb798f34f0c9d2cc95107eec6.tar.gz
cpython-b9a8ca0a6aa9251cb798f34f0c9d2cc95107eec6.tar.bz2
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).
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ba5c70b..f4e0add 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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,