Commit ebd964afcacedcec691ee36395428884229bc2b6

Authored by Thiago Franco de Moraes
1 parent 33853fa8
Exists in master

Failing to load invesalius if there is not a invesalius config

Showing 1 changed file with 9 additions and 1 deletions   Show diff stats
invesalius/session.py
... ... @@ -305,6 +305,14 @@ class Session(metaclass=Singleton):
305 305 self.random_id = config.getint('session','random_id')
306 306  
307 307 def ReadSession(self):
308   - self._read_cfg_from_json(USER_INV_CFG_PATH)
  308 + try:
  309 + self._read_cfg_from_json(USER_INV_CFG_PATH)
  310 + except Exception as e1:
  311 + debug(e1)
  312 + try:
  313 + self._read_cfg_from_ini(OLD_USER_INV_CFG_PATH)
  314 + except Exception as e2:
  315 + debug(e2)
  316 + return False
309 317 self.WriteSessionFile()
310 318 return True
... ...