From ebfbf35f2057606e95c6526823849f3bcc857d53 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 18 May 2023 23:12:33 +0800 Subject: fix find_tool from xmake/packages --- xmake/modules/detect/tools/find_python.lua | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'xmake/modules/detect/tools/find_python.lua') diff --git a/xmake/modules/detect/tools/find_python.lua b/xmake/modules/detect/tools/find_python.lua index 38a28b3bb..5f394b5e6 100644 --- a/xmake/modules/detect/tools/find_python.lua +++ b/xmake/modules/detect/tools/find_python.lua @@ -38,17 +38,14 @@ import("detect.tools.find_python3") -- @endcode -- function main(opt) - - -- init options opt = opt or {} - - -- find program local program = find_program(opt.program or "python", opt) if not program then - program = find_python3() or find_python2() + local opt2 = table.clone(opt) + opt2.program = nil + program = find_python3(opt2) or find_python2(opt2) end - -- find program version local version = nil if program and opt.version then opt.command = function () @@ -57,7 +54,5 @@ function main(opt) end version = find_programver(program, opt) end - - -- ok? return program, version end -- cgit v1.3.1