Changeset - 1341be63734a
[Not reviewed]
default
0 1 0
Søren Løvborg - 9 years ago 2017-01-02 21:43:53
sorenl@unity3d.com
cleanup: use standard NotImplementedError for abstract methods

From the Python docs on NotImplementedError:

In user defined base classes, abstract methods should raise this
exception when they require derived classes to override the method.
1 file changed with 2 insertions and 4 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/auth.py
Show inline comments
 
@@ -822,8 +822,7 @@ class PermsDecorator(object):
 
                raise HTTPForbidden()
 

	
 
    def check_permissions(self):
 
        """Dummy function for overriding"""
 
        raise Exception('You have to write this function in child class')
 
        raise NotImplementedError()
 

	
 

	
 
class HasPermissionAnyDecorator(PermsDecorator):
 
@@ -930,8 +929,7 @@ class PermsFunction(object):
 
        return result
 

	
 
    def check_permissions(self):
 
        """Dummy function for overriding"""
 
        raise Exception('You have to write this function in child class')
 
        raise NotImplementedError()
 

	
 
    def _scope(self):
 
        return '(unknown scope)'
0 comments (0 inline, 0 general)