From 3ff504461d1fc71d9ddde119b43c17e7ee1a743b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 11 Jul 2018 15:23:24 +1000 Subject: [PATCH] don't attempt to rename profile folder if it's a file --- aqt/profiles.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aqt/profiles.py b/aqt/profiles.py index 4e8e8deef..b5c94abad 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -105,7 +105,7 @@ a flash drive.""" % self.base) return os.path.join(loc, "Anki") else: p = os.path.expanduser("~/Anki") - if os.path.exists(p): + if os.path.isdir(p): return p else: loc = QStandardPaths.writableLocation(QStandardPaths.DocumentsLocation) @@ -121,7 +121,7 @@ a flash drive.""" % self.base) def maybeMigrateFolder(self): oldBase = self._oldFolderLocation() - if not os.path.exists(self.base) and os.path.exists(oldBase): + if not os.path.exists(self.base) and os.path.isdir(oldBase): shutil.move(oldBase, self.base) # Profile load/save