diff options
Diffstat (limited to 'rpkid/rpki/sundial.py')
-rw-r--r-- | rpkid/rpki/sundial.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rpkid/rpki/sundial.py b/rpkid/rpki/sundial.py index 63b3f2e2..dc322b96 100644 --- a/rpkid/rpki/sundial.py +++ b/rpkid/rpki/sundial.py @@ -53,6 +53,11 @@ def now(): """ return datetime.utcnow() +class ParseFailure(Exception): + """ + Parse failure constructing timedelta. + """ + class datetime(pydatetime.datetime): """ RPKI extensions to standard datetime.datetime class. All work here @@ -258,7 +263,7 @@ class timedelta(pydatetime.timedelta): d["seconds"] += d.pop("years") * cls.years_to_seconds return cls(**d) else: - raise RuntimeError, "Couldn't parse timedelta %r" % (arg,) + raise ParseFailure, "Couldn't parse timedelta %r" % (arg,) def convert_to_seconds(self): """ |