summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2022-04-15 14:21:35 (GMT)
committerGitHub <noreply@github.com>2022-04-15 14:21:35 (GMT)
commit72965981d1128b3923dad5e850c8cff626ae4dc7 (patch)
treefb78b68cf5c683251d5d68542faf9c4b261a90fa /Python
parentb7f83bdd0e16f82288dc3557b7e715bb5c7d96d0 (diff)
downloadcpython-72965981d1128b3923dad5e850c8cff626ae4dc7.zip
cpython-72965981d1128b3923dad5e850c8cff626ae4dc7.tar.gz
cpython-72965981d1128b3923dad5e850c8cff626ae4dc7.tar.bz2
gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH-91476)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b46b1ef..7891547 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3152,12 +3152,8 @@ handle_eval_breaker:
TARGET(BUILD_STRING) {
PyObject *str;
- PyObject *empty = PyUnicode_New(0, 0);
- if (empty == NULL) {
- goto error;
- }
- str = _PyUnicode_JoinArray(empty, stack_pointer - oparg, oparg);
- Py_DECREF(empty);
+ str = _PyUnicode_JoinArray(&_Py_STR(empty),
+ stack_pointer - oparg, oparg);
if (str == NULL)
goto error;
while (--oparg >= 0) {