# HG changeset patch # User Søren Løvborg # Date 2017-01-02 21:43:53 # Node ID 1341be63734a5b90253bdd1589caf1a01e9266d1 # Parent 9cf90371d0f107664ac324eb2ea28063e6172695 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. diff --git a/kallithea/lib/auth.py b/kallithea/lib/auth.py --- a/kallithea/lib/auth.py +++ b/kallithea/lib/auth.py @@ -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)'