diff options
Diffstat (limited to 'src/mailman/__init__.py')
| -rw-r--r-- | src/mailman/__init__.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mailman/__init__.py b/src/mailman/__init__.py index 716e7aecf..c54830915 100644 --- a/src/mailman/__init__.py +++ b/src/mailman/__init__.py @@ -30,15 +30,16 @@ except ImportError: # pragma: no cover # I hate myself: http://bugs.python.org/issue26632 -def public(thing): - if isinstance(thing, str): - mdict = sys._getframe(1).f_globals - name = thing - else: - mdict = sys.modules[thing.__module__].__dict__ - name = thing.__name__ +def public(thing=None, **kws): + mdict = (sys._getframe(1).f_globals + if thing is None + else sys.modules[thing.__module__].__dict__) dunder_all = mdict.setdefault('__all__', []) - dunder_all.append(name) + if thing is not None: + dunder_all.append(thing.__name__) + for key, value in kws.items(): + dunder_all.append(key) + mdict[key] = value return thing |
