Fix T85573: Building with Python 3.10a5 fails
Replace deprecated _PyUnicode_AsString{AndSize} usage.
T83626 still needs to be resolved before 3.10 is usable.
This commit is contained in:
@@ -136,7 +136,7 @@ bool BPy_errors_to_report_ex(ReportList *reports,
|
||||
RPT_ERROR,
|
||||
TIP_("%s: %s\nlocation: %s:%d\n"),
|
||||
error_prefix,
|
||||
_PyUnicode_AsString(pystring),
|
||||
PyUnicode_AsUTF8(pystring),
|
||||
filename,
|
||||
lineno);
|
||||
|
||||
@@ -144,12 +144,12 @@ bool BPy_errors_to_report_ex(ReportList *reports,
|
||||
fprintf(stderr,
|
||||
TIP_("%s: %s\nlocation: %s:%d\n"),
|
||||
error_prefix,
|
||||
_PyUnicode_AsString(pystring),
|
||||
PyUnicode_AsUTF8(pystring),
|
||||
filename,
|
||||
lineno);
|
||||
}
|
||||
else {
|
||||
BKE_reportf(reports, RPT_ERROR, "%s: %s", error_prefix, _PyUnicode_AsString(pystring));
|
||||
BKE_reportf(reports, RPT_ERROR, "%s: %s", error_prefix, PyUnicode_AsUTF8(pystring));
|
||||
}
|
||||
|
||||
Py_DECREF(pystring);
|
||||
|
||||
Reference in New Issue
Block a user