diff options
| author | Barry Warsaw | 2016-03-23 23:40:54 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-03-23 23:40:54 -0400 |
| commit | f51c63ca108134dd30f26641bef15bfcddd6e502 (patch) | |
| tree | b3cc41a2d54d11f62886db7ceab3985b9bee18f1 /src/mailman/__init__.py | |
| parent | ab2b619db5f3de47cffc2740901c4f82958a7d96 (diff) | |
| download | mailman-f51c63ca108134dd30f26641bef15bfcddd6e502.tar.gz mailman-f51c63ca108134dd30f26641bef15bfcddd6e502.tar.zst mailman-f51c63ca108134dd30f26641bef15bfcddd6e502.zip | |
Diffstat (limited to 'src/mailman/__init__.py')
| -rw-r--r-- | src/mailman/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mailman/__init__.py b/src/mailman/__init__.py index 15ce69608..445be2b0d 100644 --- a/src/mailman/__init__.py +++ b/src/mailman/__init__.py @@ -41,3 +41,16 @@ if 'build_sphinx' not in sys.argv: # pragma: no cover else: from mailman.core.i18n import initialize initialize() + + +# 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__ + dunder_all = mdict.setdefault('__all__', []) + dunder_all.append(name) + return thing |
