mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
don't attempt to rename profile folder if it's a file
This commit is contained in:
parent
5d80dccccb
commit
3ff504461d
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue