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))
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)