diff options
| author | Barry Warsaw | 2009-11-24 20:43:11 -0500 |
|---|---|---|
| committer | Barry Warsaw | 2009-11-24 20:43:11 -0500 |
| commit | 79d9e36a0b824548a0f2bc83cb948fc5ce668151 (patch) | |
| tree | bad1f9da24b61e7afda4017066c4f39177cce29d /src/mailman/__init__.py | |
| parent | 755dc1f981b56e4c2663b5596c95590c948ef4ad (diff) | |
| download | mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.tar.gz mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.tar.zst mailman-79d9e36a0b824548a0f2bc83cb948fc5ce668151.zip | |
Do not create the .mo files during setup. This makes things go much faster.
The tests do require a partial French translation for digester.txt, so just
include the bare minimum, already msgfmt'd in the mailman.testing package.
Diffstat (limited to 'src/mailman/__init__.py')
| -rw-r--r-- | src/mailman/__init__.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mailman/__init__.py b/src/mailman/__init__.py index 5f1ced22f..21645b4fb 100644 --- a/src/mailman/__init__.py +++ b/src/mailman/__init__.py @@ -24,6 +24,10 @@ __all__ = [ ] +import os +import sys + + # lazr.restful uses the sha module, but that's deprecated in Python 2.6 in # favor of the hashlib module. import warnings @@ -40,6 +44,12 @@ except ImportError: __path__ = pkgutil.extend_path(__path__, __name__) -# We have to initialize the i18n subsystem before anything else happens. -from mailman.core.i18n import initialize +# We have to initialize the i18n subsystem before anything else happens, +# however, we'll initialize it differently for tests. We have to do it this +# early so that module contents is set up before anything that needs it is +# imported. +if sys.argv[0].split(os.sep)[-1] == 'test': + from mailman.testing.i18n import initialize +else: + from mailman.core.i18n import initialize initialize() |
