diff options
author | Barry Warsaw <barry@python.org> | 2003-09-03 03:15:50 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2003-09-03 03:15:50 (GMT) |
commit | eb296d967b4e1ff2e87d652cf1d80f6adedb1228 (patch) | |
tree | e2c2780b8f20118d60ad2cfabaf0581840e87095 /Tools/pynche/Main.py | |
parent | 6f7b213dda6f5ebb55ea7ab6d45879530035ad58 (diff) | |
download | cpython-eb296d967b4e1ff2e87d652cf1d80f6adedb1228.zip cpython-eb296d967b4e1ff2e87d652cf1d80f6adedb1228.tar.gz cpython-eb296d967b4e1ff2e87d652cf1d80f6adedb1228.tar.bz2 |
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.
Backport candidate.
Diffstat (limited to 'Tools/pynche/Main.py')
-rw-r--r-- | Tools/pynche/Main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Tools/pynche/Main.py b/Tools/pynche/Main.py index 59d2527..1fa3f17 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) |