From d8880f032dcf25aa3b07d146851bd180ddf4d218 Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Sat, 7 Mar 2026 12:12:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84get=5Ffull=5Fpath=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/pyinvoker.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/pyinvoker.cpp b/server/pyinvoker.cpp index a4123639..37d2ed1c 100644 --- a/server/pyinvoker.cpp +++ b/server/pyinvoker.cpp @@ -239,8 +239,12 @@ PYBIND11_EMBEDDED_MODULE(mk_loader, m) { m.def("get_full_path", [](const std::string &path, const std::string ¤t_path) -> std::string { 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 { py::gil_scoped_release release;