From 228e1c57fb79411381fc0da3bcbd69fbaf3cbf9a Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Tue, 8 Oct 2013 15:45:36 +0200 Subject: Make sure the imported preferred_language exists, and work around Python issue 9666 --- src/mailman/commands/cli_import.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mailman/commands/cli_import.py') diff --git a/src/mailman/commands/cli_import.py b/src/mailman/commands/cli_import.py index c8145429d..880457334 100644 --- a/src/mailman/commands/cli_import.py +++ b/src/mailman/commands/cli_import.py @@ -35,7 +35,7 @@ from mailman.core.i18n import _ from mailman.database.transaction import transactional from mailman.interfaces.command import ICLISubCommand from mailman.interfaces.listmanager import IListManager -from mailman.utilities.importer import import_config_pck +from mailman.utilities.importer import import_config_pck, Import21Error @@ -93,4 +93,8 @@ class Import21: print(_('Ignoring non-dictionary: {0!r}').format( config_dict), file=sys.stderr) continue - import_config_pck(mlist, config_dict) + try: + import_config_pck(mlist, config_dict) + except Import21Error, e: + print(e, file=sys.stderr) + sys.exit(1) -- cgit v1.2.3-70-g09d2