changeset 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 c8bf62a6eb21
files sendpwf.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sendpwf.py	Sun Jun 05 22:57:31 2022 +0100
+++ b/sendpwf.py	Tue Jul 05 10:22:50 2022 +0100
@@ -5,7 +5,7 @@
 
 import smtplib, sys
 
-if sys.argv[1]=='-d':
+if len(sys.argv)>0 and sys.argv[1]=='-d':
   sys.argv.pop(1)
   debug=sys.argv.pop(1)
 else: