From 7f3cfd50fade7da7cda9a2168b22b8ce4defce28 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 6 Mar 2000 14:43:20 +0000 Subject: In getdef(), don't die when the section doesn't exist. --- Tools/idle/IdleConf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/idle/IdleConf.py b/Tools/idle/IdleConf.py index df5d9f8..807f183 100644 --- a/Tools/idle/IdleConf.py +++ b/Tools/idle/IdleConf.py @@ -2,7 +2,7 @@ import os import sys -from ConfigParser import ConfigParser, NoOptionError +from ConfigParser import ConfigParser, NoOptionError, NoSectionError class IdleConfParser(ConfigParser): @@ -26,7 +26,7 @@ class IdleConfParser(ConfigParser): """Get an option value for given section or return default""" try: return self.get(sec, options, raw, vars) - except NoOptionError: + except (NoSectionError, NoOptionError): return default def getsection(self, section): -- cgit v0.12