From 49831ddfc8610feb3979a8a72a498b1d05759453 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 9 Jun 2019 13:54:53 +0200 Subject: Give the 'source ...' line being parsed when a file can't be opened Helpful when env. variables are involved. Previously only shown when the file couldn't be found. --- kconfiglib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kconfiglib.py b/kconfiglib.py index c8867da..9195055 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2076,8 +2076,9 @@ class Kconfig(object): except IOError as e: # We already know that the file exists raise _KconfigIOError( - e, "{}:{}: Could not open '{}' ({}: {})" + e, "{}:{}: Could not open '{}' (in '{}') ({}: {})" .format(self._filename, self._linenr, filename, + self._line.strip(), errno.errorcode[e.errno], e.strerror)) self._filename = rel_filename -- cgit v1.2.3