Cleanup: remove workaround for old BLI_dynstr_vappendf bug

Remove workaround from 1c806f6bb4
as this doesn't seem to be needed anymore.
This commit is contained in:
Campbell Barton 2020-07-27 13:02:33 +10:00
parent b18c376946
commit 9ce2c5bf50
1 changed files with 4 additions and 16 deletions

View File

@ -128,33 +128,21 @@ bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const boo
const char *filename;
int lineno;
PyObject *pystring_format; /* workaround, see below */
const char *cstring;
PyC_FileAndNum(&filename, &lineno);
if (filename == NULL) {
filename = "<unknown location>";
}
#if 0 /* ARG!. workaround for a bug in blenders use of vsnprintf */
BKE_reportf(reports,
RPT_ERROR,
"%s\nlocation: %s:%d\n",
TIP_("%s\nlocation: %s:%d\n"),
_PyUnicode_AsString(pystring),
filename,
lineno);
#else
pystring_format = PyUnicode_FromFormat(
TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno);
cstring = _PyUnicode_AsString(pystring_format);
BKE_report(reports, RPT_ERROR, cstring);
/* not exactly needed. just for testing */
fprintf(stderr, TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno);
Py_DECREF(pystring_format); /* workaround */
#endif
/* Not exactly needed. Useful for developers tracking down issues. */
fprintf(
stderr, TIP_("%s\nlocation: %s:%d\n"), _PyUnicode_AsString(pystring), filename, lineno);
}
else {
BKE_report(reports, RPT_ERROR, _PyUnicode_AsString(pystring));