Commit 7f3cfd50 authored by Guido van Rossum's avatar Guido van Rossum

In getdef(), don't die when the section doesn't exist.

parent 074d6e1f
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment