GUI: catch ConfigParser.NoSectionError for platforms which don't throw

IOError
This commit is contained in:
Nick Foster 2013-08-21 17:57:01 -07:00
parent b7627fa2d4
commit b3021720d6

View File

@ -464,7 +464,7 @@ class mainwindow(QtGui.QMainWindow):
prefs.read(os.path.expanduser(self.opt_file)) prefs.read(os.path.expanduser(self.opt_file))
for item in prefs.items("GUI"): for item in prefs.items("GUI"):
defaults[item[0]] = item[1] defaults[item[0]] = item[1]
except IOError: except (IOError, ConfigParser.NoSectionError):
print "No preferences file %s found, creating..." % os.path.expanduser(self.opt_file) print "No preferences file %s found, creating..." % os.path.expanduser(self.opt_file)
self.write_defaults(defaults) self.write_defaults(defaults)