Skip to content

Commit 79d65e3

Browse files
committed
fixup! make _copy_string_obj_raw return a char *
1 parent a1512de commit 79d65e3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python/crossinterp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ _PyXIData_ReleaseAndRawFree(_PyXIData_t *xidata)
10381038
/* convenience utilities */
10391039
/*************************/
10401040

1041-
static const char *
1041+
static char *
10421042
_copy_string_obj_raw(PyObject *strobj, Py_ssize_t *p_size)
10431043
{
10441044
Py_ssize_t size = -1;
@@ -1139,15 +1139,15 @@ _format_TracebackException(PyObject *tbexc)
11391139
}
11401140

11411141
Py_ssize_t size = -1;
1142-
const char *formatted = _copy_string_obj_raw(formatted_obj, &size);
1142+
char *formatted = _copy_string_obj_raw(formatted_obj, &size);
11431143
Py_DECREF(formatted_obj);
11441144
if (formatted == NULL || size == 0) {
11451145
return formatted;
11461146
}
11471147
assert(formatted[size] == '\0');
11481148
// Remove a trailing newline if needed.
11491149
if (formatted[size-1] == '\n') {
1150-
((char *)formatted)[size-1] = '\0';
1150+
formatted[size-1] = '\0';
11511151
}
11521152
return formatted;
11531153
}

0 commit comments

Comments
 (0)