Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb296d9

Browse files
committed
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.
1 parent 6f7b213 commit eb296d9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Tools/pynche/Main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
initial color, as a color name or #RRGGBB format
4747
"""
4848

49-
__version__ = '1.4'
49+
__version__ = '1.4.1'
5050

5151
import sys
5252
import os
@@ -127,10 +127,12 @@ def build(master=None, initialcolor=None, initfile=None, ignore=None,
127127
# defer to the command line chosen color database, falling back to the one
128128
# in the .pynche file.
129129
if dbfile is None:
130-
dbfile = s.optiondb()['DBFILE']
130+
dbfile = s.optiondb().get('DBFILE')
131131
# find a parseable color database
132132
colordb = None
133133
files = RGB_TXT[:]
134+
if dbfile is None:
135+
dbfile = files.pop()
134136
while colordb is None:
135137
try:
136138
colordb = ColorDB.get_colordb(dbfile)

0 commit comments

Comments
 (0)