From 17d21df1b7193d627c354f11fecdf8e16e5912b4 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 24 May 2007 06:56:10 +0000 Subject: [PATCH] - return None if no option --- pisi/configfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pisi/configfile.py b/pisi/configfile.py index f051513c..e223071e 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -170,7 +170,10 @@ class ConfigurationFile(object): # sourceforge tracker id: #1410680, modified a little to make it turn into a function. def get(self, section, option): - return self.parser.get(section, option) + try: + return self.parser.get(section, option) + except ConfigParser.NoOptionError: + return None def set(self, section, option, value): self.parser.set(section, option, value)