From 62e6cae241cd6033009ef2d5a6d87fe7ea15bfe6 Mon Sep 17 00:00:00 2001 From: Nick Smith Date: Thu, 26 Feb 2015 09:57:18 +0000 Subject: Implement relativedelta.__nonzero__ for python 2.x compatibility --- dateutil/relativedelta.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'dateutil/relativedelta.py') diff --git a/dateutil/relativedelta.py b/dateutil/relativedelta.py index 2b5557a..da05572 100644 --- a/dateutil/relativedelta.py +++ b/dateutil/relativedelta.py @@ -375,6 +375,8 @@ Here is the behavior of operations with relativedelta: self.minute is None and self.second is None and self.microsecond is None) + # Compatibility with Python 2.x + __nonzero__ = __bool__ def __mul__(self, other): f = float(other) -- cgit v1.2.3