mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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:
parent
6a39e96ab8
commit
b9a8ca0a6a
22 changed files with 35 additions and 35 deletions
|
|
@ -129,7 +129,7 @@ static PyObject *
|
|||
get_timezones_offset_zero(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *offset = PyDelta_FromDSU(0, 0, 0);
|
||||
PyObject *name = PyUnicode_FromString("");
|
||||
PyObject *name = Py_GetConstant(Py_CONSTANT_EMPTY_STR);
|
||||
if (offset == NULL || name == NULL) {
|
||||
Py_XDECREF(offset);
|
||||
Py_XDECREF(name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue