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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user