Monkey patch broker mods with a name attr

kivy_mainline_and_py3.8
Tyler Goodlet 2018-04-17 17:17:08 -04:00
parent 6359623019
commit 0c7ecd383b
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ __brokers__ = [
def get_brokermod(brokername: str) -> ModuleType:
"""Return the imported broker module by name.
"""
return import_module('.' + brokername, 'piker.brokers')
module = import_module('.' + brokername, 'piker.brokers')
# we only allows monkeys because it's for internal keying
module.name = module.__name__.split('.')[-1]
return module
def iter_brokermods():