From ff2aadafba1f06c36b92906f0ff6906b2af4cc87 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 14 Nov 2007 04:22:54 +0000 Subject: Nit svn path=/scripts/rpki/sundial.py; revision=1290 --- scripts/rpki/sundial.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/rpki/sundial.py') diff --git a/scripts/rpki/sundial.py b/scripts/rpki/sundial.py index d656ca16..96a0d591 100644 --- a/scripts/rpki/sundial.py +++ b/scripts/rpki/sundial.py @@ -68,7 +68,7 @@ class datetime(pydatetime.datetime): return self.strftime("%Y-%m-%dT%H:%M:%SZ") @classmethod - def _cast(cls, x): + def fromdatetime(cls, x): """Convert a datetime.datetime object into this subclass. This is whacky due to the weird constructors for datetime. """ @@ -76,11 +76,11 @@ class datetime(pydatetime.datetime): def __add__(self, other): """Force correct class for timedelta results.""" - return self._cast(pydatetime.datetime.__add__(self, other)) + return self.fromdatetime(pydatetime.datetime.__add__(self, other)) def __sub__(self, other): """Force correct class for timedelta results.""" - return self._cast(pydatetime.datetime.__sub__(self, other)) + return self.fromdatetime(pydatetime.datetime.__sub__(self, other)) # Alias to simplify imports for callers -- cgit v1.2.3