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 /Modules/_io | |
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 'Modules/_io')
-rw-r--r-- | Modules/_io/stringio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c index 6d48bcb..f558613 100644 --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -353,7 +353,7 @@ _stringio_readline(stringio *self, Py_ssize_t limit) /* In case of overseek, return the empty string */ if (self->pos >= self->string_size) - return PyUnicode_New(0, 0); + return Py_GetConstant(Py_CONSTANT_EMPTY_STR); start = self->buf + self->pos; if (limit < 0 || limit > self->string_size - self->pos) |