--- 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'