GUI: catch ConfigParser.NoSectionError for platforms which don't throw
IOError
This commit is contained in:
parent
b7627fa2d4
commit
b3021720d6
@ -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)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user