From a543a08f1daf3bf6716d813ff94c97c8e1eec824 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Tue, 11 Dec 2012 03:43:04 +0100 Subject: Make 'source' error message more informative. --- kconfiglib.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index 7950bad..e1c4baa 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1065,15 +1065,18 @@ class Config(): elif t0 == T_SOURCE: kconfig_file = tokens.get_next() - f = os.path.join(self.base_dir, self._expand_sym_refs(kconfig_file)) + exp_kconfig_file = self._expand_sym_refs(kconfig_file) + f = os.path.join(self.base_dir, exp_kconfig_file) if not os.path.exists(f): - raise IOError, ('{0}:{1}: sourced file "{2}" not found. Perhaps ' - 'base_dir (argument to Config.__init__(), currently ' + raise IOError, ('{0}:{1}: sourced file "{2}" (expands to\n' + '"{3}") not found. Perhaps base_dir\n' + '(argument to Config.__init__(), currently\n' '"{3}") is set to the wrong value.' .format(filename, linenr, kconfig_file, + exp_kconfig_file, self.base_dir)) # Add items to the same block -- cgit v1.2.3