From e6ec61b301139c69f01b4752f20a8574106ec5cb Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 29 Mar 2009 11:48:45 +0900 Subject: [PATCH] try to fix upgrade errors --- ankiqt/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/ankiqt/__init__.py b/ankiqt/__init__.py index e0c565c1b..cac76c15c 100644 --- a/ankiqt/__init__.py +++ b/ankiqt/__init__.py @@ -78,15 +78,17 @@ def run(): os.environ['HOME'] = "c:\\anki" try: os.makedirs(os.path.expanduser("~/.anki")) - except OSError: + except: pass if os.path.exists(oldConf): - shutil.copy2(oldConf, - os.path.expanduser("~/.anki/config.db")) - shutil.copytree(oldPlugins, - os.path.expanduser("~/.anki/plugins")) + try: + shutil.copy2(oldConf, + os.path.expanduser("~/.anki/config.db")) + shutil.copytree(oldPlugins, + os.path.expanduser("~/.anki/plugins")) + except: + pass os.rename(oldConf, oldConf.replace("config.db", "config.db.old")) - app = QApplication(sys.argv) import forms