From b79300bcac33452dadf56700a0715ef4f11389f7 Mon Sep 17 00:00:00 2001 From: Hoa Nguyen Date: Wed, 5 May 2021 01:56:29 -0700 Subject: [PATCH] configs: Improve error message of missing files In PathSearchFunc.__call__(), filename is the name of the file while filepath contains the relative path to the missing file relative to $M5_PATH. Outputing the filepath in the error message makes the error message more useful as it provides the expected location of the file as well as the name of the file. Change-Id: I5f1fdb9e48ac9ae59a26d33331a4a40bc9ff9acd Signed-off-by: Hoa Nguyen Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45105 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- configs/common/SysPaths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/common/SysPaths.py b/configs/common/SysPaths.py index 2b2fca3784..762efaf97d 100644 --- a/configs/common/SysPaths.py +++ b/configs/common/SysPaths.py @@ -70,7 +70,7 @@ class PathSearchFunc(object): return next(p for p in paths if os.path.exists(p)) except StopIteration: raise IOError("Can't find file '{}' on {}." - .format(filename, self.environment_variable)) + .format(filepath, self.environment_variable)) disk = PathSearchFunc('disks') binary = PathSearchFunc('binaries')