summaryrefslogtreecommitdiffstats
path: root/Modules/unicodedata.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 /Modules/unicodedata.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 'Modules/unicodedata.c')
-rw-r--r--Modules/unicodedata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/unicodedata.c b/Modules/unicodedata.c
index 333ffe6..60bde75 100644
--- a/Modules/unicodedata.c
+++ b/Modules/unicodedata.c
@@ -413,7 +413,7 @@ unicodedata_UCD_decomposition_impl(PyObject *self, int chr)
if (UCD_Check(self)) {
const change_record *old = get_old_record(self, c);
if (old->category_changed == 0)
- return PyUnicode_FromString(""); /* unassigned */
+ return Py_GetConstant(Py_CONSTANT_EMPTY_STR); /* unassigned */
}
if (code < 0 || code >= 0x110000)