aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2021-07-07 17:50:02 +0200
committerNirbheek Chauhan <nirbheek@centricular.com>2021-08-10 15:28:20 +0530
commit4036675ae912a876afc52b3a7258090598bda1f4 (patch)
tree581dcf9c7b6276c8757261e5c53dbe8d9fdf3581
parentefe5da2bae3e45bdccc9656ff01a44520b2809d1 (diff)
downloadmeson-4036675ae912a876afc52b3a7258090598bda1f4.zip
meson-4036675ae912a876afc52b3a7258090598bda1f4.tar.gz
meson-4036675ae912a876afc52b3a7258090598bda1f4.tar.bz2
cleanup self.options.wd
It is never None and always an absolute path
-rw-r--r--mesonbuild/mdevenv.py1
-rw-r--r--mesonbuild/mdist.py1
-rw-r--r--mesonbuild/mtest.py6
3 files changed, 2 insertions, 6 deletions
diff --git a/mesonbuild/mdevenv.py b/mesonbuild/mdevenv.py
index 48108fe..c304cbb 100644
--- a/mesonbuild/mdevenv.py
+++ b/mesonbuild/mdevenv.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.')
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py
index bd1d04a..afa1b4c 100644
--- a/mesonbuild/mdist.py
+++ b/mesonbuild/mdist.py
@@ -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.')
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 8d002f6..4c1d00e 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -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)