summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-10-09 15:12:11 (GMT)
committerGitHub <noreply@github.com>2024-10-09 15:12:11 (GMT)
commit6a39e96ab8ebc1144f713988ac6fe439e4476488 (patch)
tree20f4c0367c472d07ca66c3ea15fa5c98c70af70d /Parser
parent3ee474f5683110e153fdd0cbd2024f99d6c124e5 (diff)
downloadcpython-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.c2
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