Changeset - d1f091d4b765
[Not reviewed]
default
0 3 0
Mads Kiilerich - 6 years ago 2019-11-23 21:33:49
mads@kiilerich.com
Grafted from: 99c9175e6a95
py3: support __bool__

From 2to3 -f nonzero.
3 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
kallithea/bin/base.py
Show inline comments
 
@@ -108,7 +108,7 @@ class RcConf(object):
 
    def __getitem__(self, key):
 
        return self._conf[key]
 

	
 
    def __nonzero__(self):
 
    def __bool__(self):
 
        if self._conf:
 
            return True
 
        return False
kallithea/lib/auth.py
Show inline comments
 
@@ -760,7 +760,7 @@ class _PermsFunction(object):
 
    def __init__(self, *required_perms):
 
        self.required_perms = required_perms # usually very short - a list is thus fine
 

	
 
    def __nonzero__(self):
 
    def __bool__(self):
 
        """ Defend against accidentally forgetting to call the object
 
            and instead evaluating it directly in a boolean context,
 
            which could have security implications.
kallithea/lib/rcmail/response.py
Show inline comments
 
@@ -87,7 +87,7 @@ class MailBase(object):
 
    def __delitem__(self, key):
 
        del self.headers[normalize_header(key)]
 

	
 
    def __nonzero__(self):
 
    def __bool__(self):
 
        return self.body is not None or len(self.headers) > 0 or len(self.parts) > 0
 

	
 
    def keys(self):
0 comments (0 inline, 0 general)