cleanup self.options.wd

It is never None and always an absolute path
pull/9285/head
Paolo Bonzini 3 years ago committed by Nirbheek Chauhan
parent efe5da2bae
commit 4036675ae9
  1. 1
      mesonbuild/mdevenv.py
  2. 1
      mesonbuild/mdist.py
  3. 6
      mesonbuild/mtest.py

@ -37,7 +37,6 @@ def get_env(b: build.Build, build_dir: str) -> T.Dict[str, str]:
return extra_env.get_env(env)
def run(options: argparse.Namespace) -> int:
options.wd = os.path.abspath(options.wd)
buildfile = Path(options.wd) / 'meson-private' / 'build.dat'
if not buildfile.is_file():
raise MesonException(f'Directory {options.wd!r} does not seem to be a Meson build directory.')

@ -271,7 +271,6 @@ def determine_archives_to_generate(options):
return result
def run(options):
options.wd = os.path.abspath(options.wd)
buildfile = Path(options.wd) / 'meson-private' / 'build.dat'
if not buildfile.is_file():
raise MesonException(f'Directory {options.wd!r} does not seem to be a Meson build directory.')

@ -1486,8 +1486,7 @@ class TestHarness:
startdir = os.getcwd()
try:
if self.options.wd:
os.chdir(self.options.wd)
os.chdir(self.options.wd)
self.build_data = build.load(os.getcwd())
if not self.options.setup:
self.options.setup = self.build_data.test_setup_default_name
@ -1657,8 +1656,7 @@ class TestHarness:
self.name_max_len = max([uniwidth(self.get_pretty_suite(test)) for test in tests])
startdir = os.getcwd()
try:
if self.options.wd:
os.chdir(self.options.wd)
os.chdir(self.options.wd)
runners = [] # type: T.List[SingleTestRunner]
for i in range(self.options.repeat):
runners.extend(self.get_test_runner(test) for test in tests)

Loading…
Cancel
Save