From b3021720d62d9d074b05b5f43eb349b149fe7f85 Mon Sep 17 00:00:00 2001 From: Nick Foster Date: Wed, 21 Aug 2013 17:57:01 -0700 Subject: [PATCH] GUI: catch ConfigParser.NoSectionError for platforms which don't throw IOError --- apps/modes_gui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/modes_gui b/apps/modes_gui index 9a8ffb6..9c09d6d 100755 --- a/apps/modes_gui +++ b/apps/modes_gui @@ -464,7 +464,7 @@ class mainwindow(QtGui.QMainWindow): prefs.read(os.path.expanduser(self.opt_file)) for item in prefs.items("GUI"): defaults[item[0]] = item[1] - except IOError: + except (IOError, ConfigParser.NoSectionError): print "No preferences file %s found, creating..." % os.path.expanduser(self.opt_file) self.write_defaults(defaults)