From e5d7bb56758bdc465bf6e5dd0c481362f30e63e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 10 Mar 2008 16:46:07 +0100 Subject: Generate correct KeyNotFoundException --- portato/config_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'portato/config_parser.py') diff --git a/portato/config_parser.py b/portato/config_parser.py index f4c6218..ee838b2 100644 --- a/portato/config_parser.py +++ b/portato/config_parser.py @@ -291,12 +291,12 @@ class ConfigParser: """ try: - section = self.vars[section] + sectiondict = self.vars[section] except KeyError: raise SectionNotFoundException("Section '%s' not found in file '%s'." % (section, self.file)) try: - return section[key] + return sectiondict[key] except KeyError: raise KeyNotFoundException("Key '%s' not found in section '%s' in file '%s'." % (key, section, self.file)) -- cgit v1.2.3