# HG changeset patch # User Aurelien Campeas # Date 1337155077 -7200 # Node ID eb6a607a0067745bdeb37d67c6a57e1bd2fa545f # Parent 79534887943ed69eb541ebf980e2fa67a8966d1b [migration] do not crash if the conf file is already migrated (closes #2361061) diff -r 79534887943e -r eb6a607a0067 misc/migration/3.15.0_common.py --- a/misc/migration/3.15.0_common.py Tue May 15 14:44:45 2012 +0200 +++ b/misc/migration/3.15.0_common.py Wed May 16 09:57:57 2012 +0200 @@ -1,2 +1,7 @@ -undo_actions = config.cfgfile_parser.get('MAIN', 'undo-support', False) -config.global_set_option('undo-enabled', bool(undo_actions)) +import ConfigParser +try: + undo_actions = config.cfgfile_parser.get('MAIN', 'undo-support', False) +except ConfigParser.NoOptionError: + pass # this conf. file was probably already migrated +else: + config.global_set_option('undo-enabled', bool(undo_actions))