diff options
author | Victor Stinner <vstinner@python.org> | 2024-10-09 15:12:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-09 15:12:11 (GMT) |
commit | 6a39e96ab8ebc1144f713988ac6fe439e4476488 (patch) | |
tree | 20f4c0367c472d07ca66c3ea15fa5c98c70af70d /Parser | |
parent | 3ee474f5683110e153fdd0cbd2024f99d6c124e5 (diff) | |
download | cpython-6a39e96ab8ebc1144f713988ac6fe439e4476488.zip cpython-6a39e96ab8ebc1144f713988ac6fe439e4476488.tar.gz cpython-6a39e96ab8ebc1144f713988ac6fe439e4476488.tar.bz2 |
gh-115754: Use Py_GetConstant(Py_CONSTANT_EMPTY_BYTES) (#125195)
Replace PyBytes_FromString("") and PyBytes_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_BYTES).
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/action_helpers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/action_helpers.c b/Parser/action_helpers.c index 1972c60..24b817c 100644 --- a/Parser/action_helpers.c +++ b/Parser/action_helpers.c @@ -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 |