Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add _Py_EMPTY_STR.
  • Loading branch information
ericsnowcurrently committed Feb 13, 2024
commit f68737bd35db73f5317ee2a4b31eb5411f362f29
7 changes: 6 additions & 1 deletion Python/crossinterp.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ _convert_exc_to_TracebackException(PyObject *exc, PyObject **p_tbexc)
return -1;
}

// We accommodate backports here.
#ifndef _Py_EMPTY_STR
# define _Py_EMPTY_STR &_Py_STR(empty)
#endif

static const char *
_format_TracebackException(PyObject *tbexc)
Expand All @@ -492,7 +496,8 @@ _format_TracebackException(PyObject *tbexc)
if (lines == NULL) {
return NULL;
}
PyObject *formatted_obj = PyUnicode_Join(&_Py_STR(empty), lines);
assert(_Py_EMPTY_STR != NULL);
PyObject *formatted_obj = PyUnicode_Join(_Py_EMPTY_STR, lines);
Py_DECREF(lines);
if (formatted_obj == NULL) {
return NULL;
Expand Down