Skip to content
Snippets Groups Projects
Commit 8147cd7f authored by David Douard's avatar David Douard
Browse files

api: kind of fix for the SWHRemoteAPI's contructor

- ensure we do accept **kwargs so any super().__init__(**kwargs) from an
  unexpected MRO path in an indecent maze of multi-inheritance will not crash
- do not call super().__init__(); it is either useless (most probably,
  super() is object in this context) or silently ignore passed kwargs that
  super() (when it's not object) may have been able to understand...

Long story short, kwargs handling in multi-inheritance __init__ methods is
a mess.
parent 5299aa75
No related branches found
No related tags found
1 merge request!50api: kind of fix for the SWHRemoteAPI's contructor
......@@ -141,8 +141,8 @@ class SWHRemoteAPI(metaclass=MetaSWHRemoteAPI):
This backend class will never be instantiated, it only serves as
a template."""
def __init__(self, api_exception, url, timeout=None, chunk_size=4096):
super().__init__()
def __init__(self, api_exception, url,
timeout=None, chunk_size=4096, **kwargs):
self.api_exception = api_exception
base_url = url if url.endswith('/') else url + '/'
self.url = base_url
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment