From c8237bb7669ad922af2183906f23f65c49685b54 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 11 Dec 2020 10:06:14 -0800 Subject: [PATCH] fix to print older wordlists with tiny headers --- xwords4/dawg/dawg2dict.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xwords4/dawg/dawg2dict.py b/xwords4/dawg/dawg2dict.py index 6a4da909d..d27ef70d6 100755 --- a/xwords4/dawg/dawg2dict.py +++ b/xwords4/dawg/dawg2dict.py @@ -155,11 +155,14 @@ def process(args): print( 'header: read nWords: {}'.format(nWords ), file=sys.stderr ) - msg = getNullTermParam(header) - if args.DUMP_MSG: - print( 'msg: {}'.format(msg)) - md5Sum = getNullTermParam(header) - print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr ) + try: # older wordlists won't have these + msg = getNullTermParam(header) + if args.DUMP_MSG: + print( 'msg: {}'.format(msg)) + md5Sum = getNullTermParam(header) + print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr ) + except: + md5Sum = None if args.GET_SUM: print( '{}'.format(md5Sum), file=sys.stdout )