Commit eb296d96 authored by Barry Warsaw's avatar Barry Warsaw

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.
parent 6f7b213d
...@@ -46,7 +46,7 @@ Where: ...@@ -46,7 +46,7 @@ Where:
initial color, as a color name or #RRGGBB format initial color, as a color name or #RRGGBB format
""" """
__version__ = '1.4' __version__ = '1.4.1'
import sys import sys
import os import os
...@@ -127,10 +127,12 @@ def build(master=None, initialcolor=None, initfile=None, ignore=None, ...@@ -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 # defer to the command line chosen color database, falling back to the one
# in the .pynche file. # in the .pynche file.
if dbfile is None: if dbfile is None:
dbfile = s.optiondb()['DBFILE'] dbfile = s.optiondb().get('DBFILE')
# find a parseable color database # find a parseable color database
colordb = None colordb = None
files = RGB_TXT[:] files = RGB_TXT[:]
if dbfile is None:
dbfile = files.pop()
while colordb is None: while colordb is None:
try: try:
colordb = ColorDB.get_colordb(dbfile) colordb = ColorDB.get_colordb(dbfile)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment