changeset 181:bf58e5718f62

Replace an assert by a real exception when parsing timestamps
author Franz Glasner <hg@dom66.de>
date Thu, 06 Sep 2018 09:13:10 +0200
parents d799c2be6e81
children eb4ef206d3dd
files extensions/timestamps.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/timestamps.py	Tue Sep 04 09:37:17 2018 +0200
+++ b/extensions/timestamps.py	Thu Sep 06 09:13:10 2018 +0200
@@ -434,7 +434,8 @@
                     *[int(d, 10) for d in dtparts])
                     datano += 1
                 else:
-                    assert False
+                    raise ValueError("invalid timestamp format in line %d"
+                                     % lineno)
             elif not record:
                 self._d["/-%d/" % lineno] = None
             elif len(record) == 1: