diff options
author | Rob Austein <sra@hactrn.net> | 2011-10-05 17:45:34 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2011-10-05 17:45:34 +0000 |
commit | f7c79af8743b7142e438e5db0af960cf91938b23 (patch) | |
tree | ce7c8521f681db0d45800f0231c0de596b27499a /rpkid/rpki/sundial.py | |
parent | 72e42a6508ff19a315a0257dda4a710bc195dffa (diff) |
Stop abusing RuntimeError. This closes #52.
svn path=/rpkid/portal-gui/scripts/load_csv.py; revision=4015
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): """ |