Use super().__init__ instead of explicitly calling named super-class. (#9166)

* Use super().__init__ instead of explicitly calling named super-class.

* Fix unittest (typo fix).
This commit is contained in:
Mads Jensen
2022-01-09 22:50:44 +01:00
committed by GitHub
parent ed7964b424
commit 7e5e51aeff
5 changed files with 12 additions and 14 deletions
+2 -1
View File
@@ -167,6 +167,7 @@ class ErrorHandler:
logger.debug("Calling signal %s", signum)
os.kill(os.getpid(), signum)
class ExitHandler(ErrorHandler):
"""Context manager for running code that must be cleaned up.
@@ -175,5 +176,5 @@ class ExitHandler(ErrorHandler):
regular exit.
"""
def __init__(self, func: Callable[..., Any], *args: Any, **kwargs: Any) -> None:
ErrorHandler.__init__(self, func, *args, **kwargs)
super().__init__(func, *args, **kwargs)
self.call_on_regular_exit = True
+1 -1
View File
@@ -133,7 +133,7 @@ class CredentialsConfigurationTest(test_util.TempDirTestCase):
def __init__(self, *args, **kwargs):
self.reset()
logging.Handler.__init__(self, *args, **kwargs)
super().__init__(*args, **kwargs)
def emit(self, record):
self.messages[record.levelname.lower()].append(record.getMessage())