Mercurial > hg > python
changeset 52:10f17205908f
debug info for bad subdict
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Mon, 29 May 2023 21:57:13 +0100 |
parents | 44fea514ca45 |
children | 91d71e9760e8 |
files | mailer.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mailer.py Sun Feb 19 16:44:06 2023 +0000 +++ b/mailer.py Mon May 29 21:57:13 2023 +0100 @@ -402,7 +402,12 @@ for l in addrFile: addrFields=l.rstrip().split('\t') if doSub: - bodyPlus=body%subDict(addrFields) + try: + bodyPlus=body%subDict(addrFields) + except KeyError: + print("can't subDict",repr(subDict(addrFields)), + body) + usage('-S') else: bodyPlus=body if signature is not None: