Commit 77d5616b authored by Denis Bilenko's avatar Denis Bilenko

accept keyword arguments in get_hub()

parent 2bfa8484
...@@ -146,7 +146,7 @@ def get_hub_class(): ...@@ -146,7 +146,7 @@ def get_hub_class():
return hubtype return hubtype
def get_hub(*args): def get_hub(*args, **kwargs):
"""Return the hub for the current thread. """Return the hub for the current thread.
If hub does not exists in the current thread, the new one is created with call to :meth:`get_hub_class`. If hub does not exists in the current thread, the new one is created with call to :meth:`get_hub_class`.
...@@ -156,7 +156,7 @@ def get_hub(*args): ...@@ -156,7 +156,7 @@ def get_hub(*args):
return _threadlocal.hub return _threadlocal.hub
except AttributeError: except AttributeError:
hubtype = get_hub_class() hubtype = get_hub_class()
hub = _threadlocal.hub = hubtype(*args) hub = _threadlocal.hub = hubtype(*args, **kwargs)
return hub return hub
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment