完善get_full_path接口
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
Linux_Python / build (push) Waiting to run
macOS / build (push) Waiting to run
macOS_Python / build (push) Waiting to run
Windows / build (push) Waiting to run
Windows_Python / build (push) Waiting to run

This commit is contained in:
xia-chu 2026-03-07 12:12:28 +08:00
parent 6c82601fe2
commit d8880f032d

View File

@ -239,8 +239,12 @@ PYBIND11_EMBEDDED_MODULE(mk_loader, m) {
m.def("get_full_path", [](const std::string &path, const std::string &current_path) -> std::string { m.def("get_full_path", [](const std::string &path, const std::string &current_path) -> std::string {
py::gil_scoped_release release; py::gil_scoped_release release;
return File::absolutePath(path, current_path); switch (path.front()) {
}); case '/':
case '\\': return path;
default: return File::absolutePath(path, current_path);
}
}, py::arg("path"), py::arg("current_path") = "");
m.def("set_config", [](const std::string &key, const std::string &value) -> bool { m.def("set_config", [](const std::string &key, const std::string &value) -> bool {
py::gil_scoped_release release; py::gil_scoped_release release;