From 483b261019499f1f4292842c02dbd92dcd48ffd4 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 23 Aug 2014 19:09:28 +0400 Subject: [PATCH] When processing exception from _load do not allow overwriting it If `self.loaded.pop` raises KeyError then this KeyError will be logged, not the initial exception from `self._load`. --- powerline/lib/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerline/lib/config.py b/powerline/lib/config.py index d56b3c68..8742667b 100644 --- a/powerline/lib/config.py +++ b/powerline/lib/config.py @@ -195,11 +195,11 @@ class ConfigLoader(MultiRunnedThread): try: self.loaded[path] = deepcopy(self._load(path)) except Exception as e: + self.exception('Error while loading {0}: {1}', path, str(e)) try: self.loaded.pop(path) except KeyError: pass - self.exception('Error while loading {0}: {1}', path, str(e)) try: self.loaded.pop(path) except KeyError: