From 7b24e352065a15cc71ccf5afb70172a1896209a6 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sat, 29 Mar 2025 22:32:01 +0100 Subject: [PATCH] super(..) -> super() --- rules_light/exceptions.py | 4 ++-- rules_light/middleware.py | 2 +- rules_light/registry.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rules_light/exceptions.py b/rules_light/exceptions.py index 41d8ddc..bacc5ce 100644 --- a/rules_light/exceptions.py +++ b/rules_light/exceptions.py @@ -8,10 +8,10 @@ class RulesLightException(Exception): class Denied(RulesLightException): def __init__(self, rule_text): - super(Denied, self).__init__(u'%s evaluates to False' % rule_text) + super().__init__(u'%s evaluates to False' % rule_text) class DoesNotExist(RulesLightException): def __init__(self, name): - super(DoesNotExist, self).__init__( + super().__init__( u'Rule "%s" is not registered' % name) diff --git a/rules_light/middleware.py b/rules_light/middleware.py index bee8365..6e27e02 100644 --- a/rules_light/middleware.py +++ b/rules_light/middleware.py @@ -33,7 +33,7 @@ def process_exception(self, request, exception): 'rules_light/exception.html', ctx)) def __init__(self, get_response=None): - super(Middleware, self).__init__() + super().__init__() # Support Django 1.10 middleware. if get_response is not None: self.get_response = get_response diff --git a/rules_light/registry.py b/rules_light/registry.py index e7b5a1e..a2f4b77 100644 --- a/rules_light/registry.py +++ b/rules_light/registry.py @@ -38,7 +38,7 @@ def __setitem__(self, key, value): """ Adds a debug-level log on registration. """ - super(RuleRegistry, self).__setitem__(key, value) + super().__setitem__(key, value) self.logger.debug(u'[rules_light] "%s" registered with: %s' % ( key, self.rule_text_name(value)))