devtools/__init__.py
changeset 10819 5b5864483c4d
parent 10796 26a36c2a5fbd
child 10888 fbbb028d0a75
equal deleted inserted replaced
10818:8cdf9965b2b8 10819:5b5864483c4d
   368 
   368 
   369         takes as argument value stored in db_cache by self._backup_database"""
   369         takes as argument value stored in db_cache by self._backup_database"""
   370         # XXX set a clearer error message ???
   370         # XXX set a clearer error message ???
   371         backup_coordinates, config_path = self.db_cache[self.db_cache_key(db_id)]
   371         backup_coordinates, config_path = self.db_cache[self.db_cache_key(db_id)]
   372         # reload the config used to create the database.
   372         # reload the config used to create the database.
   373         config = pickle.loads(open(config_path, 'rb').read())
   373         with open(config_path, 'rb') as f:
       
   374             config = pickle.load(f)
   374         # shutdown repo before changing database content
   375         # shutdown repo before changing database content
   375         if self._repo is not None:
   376         if self._repo is not None:
   376             self._repo.turn_repo_off()
   377             self._repo.turn_repo_off()
   377         self._restore_database(backup_coordinates, config)
   378         self._restore_database(backup_coordinates, config)
   378 
   379