diff options
author | Victor Stinner <vstinner@python.org> | 2024-10-09 15:15:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-09 15:15:23 (GMT) |
commit | b9a8ca0a6aa9251cb798f34f0c9d2cc95107eec6 (patch) | |
tree | 570ffb9eae19501a3a173fab2dbf56490d1f83db /Python/codecs.c | |
parent | 6a39e96ab8ebc1144f713988ac6fe439e4476488 (diff) | |
download | cpython-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/codecs.c')
-rw-r--r-- | Python/codecs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 68dc232..2cb3875 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -696,7 +696,7 @@ PyObject *PyCodec_IgnoreErrors(PyObject *exc) wrong_exception_type(exc); return NULL; } - return Py_BuildValue("(Nn)", PyUnicode_New(0, 0), end); + return Py_BuildValue("(Nn)", Py_GetConstant(Py_CONSTANT_EMPTY_STR), end); } |