Fix running tests when there is a period in PATH.
This commit is contained in:
parent
f70760a510
commit
4ca1e8638c
|
@ -32,6 +32,13 @@ def detect_meson_py_location():
|
||||||
# $ meson <args> (gets run from /usr/bin/meson)
|
# $ meson <args> (gets run from /usr/bin/meson)
|
||||||
in_path_exe = shutil.which(c_fname)
|
in_path_exe = shutil.which(c_fname)
|
||||||
if in_path_exe:
|
if in_path_exe:
|
||||||
|
# Special case: when run like "./meson.py <opts>" and user has
|
||||||
|
# period in PATH, we need to expand it out, because, for example,
|
||||||
|
# "ninja test" will be run from a different directory.
|
||||||
|
if '.' in os.environ['PATH'].split(':'):
|
||||||
|
p, f = os.path.split(in_path_exe)
|
||||||
|
if p == '' or p == '.':
|
||||||
|
return os.path.join(os.getcwd(), f)
|
||||||
return in_path_exe
|
return in_path_exe
|
||||||
# $ python3 ./meson.py <args>
|
# $ python3 ./meson.py <args>
|
||||||
if os.path.exists(c):
|
if os.path.exists(c):
|
||||||
|
@ -52,7 +59,6 @@ else:
|
||||||
python_command = [sys.executable]
|
python_command = [sys.executable]
|
||||||
meson_command = python_command + [detect_meson_py_location()]
|
meson_command = python_command + [detect_meson_py_location()]
|
||||||
|
|
||||||
|
|
||||||
# Put this in objects that should not get dumped to pickle files
|
# Put this in objects that should not get dumped to pickle files
|
||||||
# by accident.
|
# by accident.
|
||||||
import threading
|
import threading
|
||||||
|
|
Loading…
Reference in New Issue