From f7c79af8743b7142e438e5db0af960cf91938b23 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 5 Oct 2011 17:45:34 +0000 Subject: Stop abusing RuntimeError. This closes #52. svn path=/rpkid/portal-gui/scripts/load_csv.py; revision=4015 --- rpkid/rpki/sundial.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'rpkid/rpki/sundial.py') 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): """ -- cgit v1.2.3