[py3k] __nonzero__ → __bool__
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 16 Sep 2015 15:50:42 +0200
changeset 10690 c6290d727c0c
parent 10689 49a62b8f6d43
child 10691 af266f27c4d5
[py3k] __nonzero__ → __bool__
utils.py
web/request.py
--- a/utils.py	Wed Sep 16 15:17:42 2015 +0200
+++ b/utils.py	Wed Sep 16 15:50:42 2015 +0200
@@ -226,9 +226,11 @@
         self.tracewrites = tracewrites
         super(UStringIO, self).__init__(*args, **kwargs)
 
-    def __nonzero__(self):
+    def __bool__(self):
         return True
 
+    __nonzero__ = __bool__
+
     def write(self, value):
         assert isinstance(value, text_type), u"unicode required not %s : %s"\
                                      % (type(value).__name__, repr(value))
--- a/web/request.py	Wed Sep 16 15:17:42 2015 +0200
+++ b/web/request.py	Wed Sep 16 15:50:42 2015 +0200
@@ -967,8 +967,10 @@
     def __getattribute__(self, attr):
         raise AuthenticationError()
 
-    def __nonzero__(self):
+    def __bool__(self):
         return False
+    
+    __nonzero__ = __bool__
 
 class _MockAnonymousSession(object):
     sessionid = 'thisisnotarealsession'