summaryrefslogtreecommitdiff
path: root/django/utils/tree.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/tree.py')
-rw-r--r--django/utils/tree.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/utils/tree.py b/django/utils/tree.py
index 717181d2b9..ce490224e0 100644
--- a/django/utils/tree.py
+++ b/django/utils/tree.py
@@ -73,7 +73,9 @@ class Node(object):
For truth value testing.
"""
return bool(self.children)
- __nonzero__ = __bool__ # Python 2
+
+ def __nonzero__(self): # Python 2 compatibility
+ return type(self).__bool__(self)
def __contains__(self, other):
"""