App: Address reviewer comments
This commit is contained in:
@@ -569,7 +569,7 @@ void ApplicationDirectories::migrateAllPaths(const std::vector<fs::path> &paths)
|
||||
newPath = path / versionStringForPath(major, minor);
|
||||
}
|
||||
if (fs::exists(newPath)) {
|
||||
throw Base::RuntimeError("Cannot migrate config - path already exists: " + Base::FileInfo::pathToString(newPath));
|
||||
continue; // Ignore an existing path: not an error, just a migration that was already done
|
||||
}
|
||||
fs::create_directories(newPath);
|
||||
migrateConfig(path, newPath);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user