Explorar o código

tau: wrong due date exit with error instead assert

dasman hai 1 ano
pai
achega
21ca366998
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      bin/tau/tau-python/tau

+ 3 - 1
bin/tau/tau-python/tau

@@ -145,7 +145,9 @@ def convert_attr_val(attr, val):
             sys.exit(-1)
     elif attr == "due":
         # Other date formats not yet supported... ez to add
-        assert len(val) == 4
+        if len(val) != 4:
+            print(f"Error: due date must be of length 4 in mmyy format")
+            sys.exit(-1)
         date = datetime.now().date()
         year = int(date.strftime("%Y"))%100
         try: