From: Barry Warsaw Date: Wed, 3 Sep 2003 03:23:44 +0000 (+0000) Subject: Fix for SF bug #780996, crash when no .pynche file exists and -d X-Git-Tag: v2.3.1~97 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a217edb427440b4b8eb190e2d3340880c99edcfd;p=thirdparty%2FPython%2Fcpython.git Fix for SF bug #780996, crash when no .pynche file exists and -d option is not given. If dbfile isn't given and can't be retrieved from the optionsdb, just initialize it to the first element in RGB_TXT. (backported) --- diff --git a/Tools/pynche/Main.py b/Tools/pynche/Main.py index 59d2527a4cd0..1fa3f175c8a3 100644 --- a/Tools/pynche/Main.py +++ b/Tools/pynche/Main.py @@ -46,7 +46,7 @@ Where: initial color, as a color name or #RRGGBB format """ -__version__ = '1.4' +__version__ = '1.4.1' import sys import os @@ -127,10 +127,12 @@ def build(master=None, initialcolor=None, initfile=None, ignore=None, # defer to the command line chosen color database, falling back to the one # in the .pynche file. if dbfile is None: - dbfile = s.optiondb()['DBFILE'] + dbfile = s.optiondb().get('DBFILE') # find a parseable color database colordb = None files = RGB_TXT[:] + if dbfile is None: + dbfile = files.pop() while colordb is None: try: colordb = ColorDB.get_colordb(dbfile)