Core: Python translate() wrapper arg correction

translate()'s third argument is an optional string used as a comment:
"None" is a valid value for this argument (and is indeed the stated
default in the documentation), but as originally written it was not
accepted, only actual strings were allowed. This commit modifies the
format string from "s" to "z", allowing an explicit None argument.
This commit is contained in:
Chris Hennes
2022-02-01 21:12:49 -06:00
parent cfdf334b7f
commit 8859b8e4cd

View File

@@ -83,7 +83,7 @@ Py::Object Translate::translate(const Py::Tuple& args)
char *source;
char *disambiguation = nullptr;
int n=-1;
if (!PyArg_ParseTuple(args.ptr(), "ss|si", &context, &source, &disambiguation, &n))
if (!PyArg_ParseTuple(args.ptr(), "ss|zi", &context, &source, &disambiguation, &n))
throw Py::Exception();
QString str = QCoreApplication::translate(context, source, disambiguation, n);