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:
2021-02-13 22:57:01 +11:00
parent 32660201ac
commit dae445d94a
25 changed files with 96 additions and 97 deletions

View File

@@ -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);