mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
usage(): Print msg at end of docstring
main(): Fixed logic error and reporting when no colordb was found. Given by GvR.
This commit is contained in:
parent
7c51a9a80b
commit
14e2cafe21
1 changed files with 4 additions and 3 deletions
|
|
@ -55,9 +55,9 @@ RGB_TXT = [
|
|||
|
||||
|
||||
def usage(status, msg=''):
|
||||
print __doc__ % globals()
|
||||
if msg:
|
||||
print msg
|
||||
print __doc__ % globals()
|
||||
sys.exit(status)
|
||||
|
||||
|
||||
|
|
@ -88,11 +88,12 @@ def main():
|
|||
for f in RGB_TXT:
|
||||
try:
|
||||
colordb = ColorDB.get_colordb(f)
|
||||
break
|
||||
if colordb:
|
||||
break
|
||||
except IOError:
|
||||
pass
|
||||
else:
|
||||
raise IOError('No color database file found')
|
||||
usage(1, 'No color database file found, see the -d option.')
|
||||
|
||||
# get triplet for initial color
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue