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:
@@ -740,7 +740,7 @@ get_locale_info(enum LocaleType type, LocaleInfo *locale_info)
|
||||
break;
|
||||
case LT_NO_LOCALE:
|
||||
locale_info->decimal_point = PyUnicode_FromOrdinal('.');
|
||||
locale_info->thousands_sep = PyUnicode_New(0, 0);
|
||||
locale_info->thousands_sep = Py_GetConstant(Py_CONSTANT_EMPTY_STR);
|
||||
if (!locale_info->decimal_point || !locale_info->thousands_sep)
|
||||
return -1;
|
||||
locale_info->grouping = no_grouping;
|
||||
|
||||
Reference in New Issue
Block a user