mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195)
Replace PyBytes_FromString("") and PyBytes_FromStringAndSize("", 0) with Py_GetConstant(Py_CONSTANT_EMPTY_BYTES).
This commit is contained in:
parent
3ee474f568
commit
6a39e96ab8
6 changed files with 9 additions and 9 deletions
|
@ -1541,7 +1541,7 @@ _PyPegen_concatenate_strings(Parser *p, asdl_expr_seq *strings,
|
|||
}
|
||||
|
||||
if (bytes_found) {
|
||||
PyObject* res = PyBytes_FromString("");
|
||||
PyObject* res = Py_GetConstant(Py_CONSTANT_EMPTY_BYTES);
|
||||
|
||||
/* Bytes literals never get a kind, but just for consistency
|
||||
since they are represented as Constant nodes, we'll mirror
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue