diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index df9fd733ff..7c9d3a0852 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -122,12 +122,13 @@ if __name__ == '__main__':
sys.exit("missing command after '--'")
cmd = args.tests
env.print_env()
- exec_path = Path(shutil.which(cmd[0]))
- if exec_path is None:
+ exec_pathstr = shutil.which(cmd[0])
+ if exec_pathstr is None:
sys.exit('command not found: ' + cmd[0])
- cmd[0] = exec_path.resolve()
+ exec_path = Path(exec_pathstr).resolve()
+ cmd[0] = str(exec_path)
full_env = env.prepare_subprocess(cmd)
- os.chdir(Path(exec_path).parent)
+ os.chdir(exec_path.parent)
os.execve(cmd[0], cmd, full_env)
testfinder = TestFinder(test_dir=env.source_iotests)
But now these are so many changes that I feel uncomfortable making this
change myself. This series only affects the iotests, so AFAIU we are in
no hurry to get this into rc1, and it can still go into rc2.