App: Address reviewer comments

This commit is contained in:
Chris Hennes
2025-09-17 16:08:07 -05:00
parent 0dcbac7b30
commit b64b0f528b
2 changed files with 8 additions and 9 deletions

View File

@@ -70,17 +70,16 @@ std::string ApplicationDirectoriesPy::representation() const
for (Py::Sequence::size_type i = 0; i < size; i++) {
Py::Object item = seq[i];
if (PyUnicode_Check(item.ptr())) {
const char* s = PyUnicode_AsUTF8(item.ptr());
if (!s) {
return nullptr; // PyUnicode_AsUTF8 sets an error
}
paths[i] = Base::FileInfo::stringToPath(s);
}
else {
if (!PyUnicode_Check(item.ptr())) {
PyErr_SetString(PyExc_RuntimeError, "path was not a string");
return nullptr;
}
const char* s = PyUnicode_AsUTF8(item.ptr());
if (!s) {
return nullptr; // PyUnicode_AsUTF8 sets an error
}
paths[i] = Base::FileInfo::stringToPath(s);
}
App::Application::directories()->migrateAllPaths(paths);
}