mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +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
|
@ -354,7 +354,7 @@ static void _dump_symtable(PySTEntryObject* ste, PyObject* prefix)
|
|||
|
||||
static void dump_symtable(PySTEntryObject* ste)
|
||||
{
|
||||
PyObject *empty = PyUnicode_FromString("");
|
||||
PyObject *empty = Py_GetConstant(Py_CONSTANT_EMPTY_STR);
|
||||
assert(empty != NULL);
|
||||
_dump_symtable(ste, empty);
|
||||
Py_DECREF(empty);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue