Mercurial > hg > python
comparison sendpwf.py @ 45:7d4da4e72d37
fix argv handling
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Tue, 05 Jul 2022 10:22:50 +0100 |
parents | 737cd0fd5adb |
children |
comparison
equal
deleted
inserted
replaced
44:737cd0fd5adb | 45:7d4da4e72d37 |
---|---|
3 from email.message import EmailMessage | 3 from email.message import EmailMessage |
4 from email.policy import SMTP | 4 from email.policy import SMTP |
5 | 5 |
6 import smtplib, sys | 6 import smtplib, sys |
7 | 7 |
8 if sys.argv[1]=='-d': | 8 if len(sys.argv)>0 and sys.argv[1]=='-d': |
9 sys.argv.pop(1) | 9 sys.argv.pop(1) |
10 debug=sys.argv.pop(1) | 10 debug=sys.argv.pop(1) |
11 else: | 11 else: |
12 debug=None | 12 debug=None |
13 | 13 |