summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/datastructures.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index 2efcd00eb0..49fd9d9848 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -271,9 +271,12 @@ class OrderedSet(object):
def __contains__(self, item):
return item in self.dict
- def __nonzero__(self):
+ def __bool__(self):
return bool(self.dict)
+ def __nonzero__(self): # Python 2 compatibility
+ return type(self).__bool__(self)
+
class MultiValueDictKeyError(KeyError):
pass