diff options
author | Rob Austein <sra@hactrn.net> | 2007-11-14 04:22:54 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-11-14 04:22:54 +0000 |
commit | ff2aadafba1f06c36b92906f0ff6906b2af4cc87 (patch) | |
tree | fe6bf9924e8723febf07637a5f2a5e020facf91c /scripts | |
parent | b46905f0f68f64abc938bac5f23f7a81c0b8d39e (diff) |
Nit
svn path=/scripts/rpki/sundial.py; revision=1290
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/rpki/sundial.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |