~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/commands/cli_import.py

  • Committer: Aurélien Bompard
  • Date: 2013-10-08 13:45:36 UTC
  • Revision ID: aurelien@bompard.org-20131008134536-nv8r7t2b38mrt1rw
Make sure the imported preferred_language exists, and work around Python issue 9666

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from mailman.database.transaction import transactional
36
36
from mailman.interfaces.command import ICLISubCommand
37
37
from mailman.interfaces.listmanager import IListManager
38
 
from mailman.utilities.importer import import_config_pck
 
38
from mailman.utilities.importer import import_config_pck, Import21Error
39
39
 
40
40
 
41
41
 
93
93
                        print(_('Ignoring non-dictionary: {0!r}').format(
94
94
                            config_dict), file=sys.stderr)
95
95
                        continue
96
 
                    import_config_pck(mlist, config_dict)
 
96
                    try:
 
97
                        import_config_pck(mlist, config_dict)
 
98
                    except Import21Error, e:
 
99
                        print(e, file=sys.stderr)
 
100
                        sys.exit(1)