summaryrefslogtreecommitdiff
path: root/xmake/modules/detect/tools/find_python.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-05-18 23:12:33 +0800
committerruki <[email protected]>2023-05-18 23:12:33 +0800
commitebfbf35f2057606e95c6526823849f3bcc857d53 (patch)
tree2b61fe52cdd7fea965d37fa350b3203c223d1a95 /xmake/modules/detect/tools/find_python.lua
parent3bc9b2b0a6344201baf2ffa0662df23c03a8cdf2 (diff)
fix find_tool from xmake/packages
Diffstat (limited to 'xmake/modules/detect/tools/find_python.lua')
-rw-r--r--xmake/modules/detect/tools/find_python.lua11
1 files changed, 3 insertions, 8 deletions
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