mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32: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")
|
return os.path.join(loc, "Anki")
|
||||||
else:
|
else:
|
||||||
p = os.path.expanduser("~/Anki")
|
p = os.path.expanduser("~/Anki")
|
||||||
if os.path.exists(p):
|
if os.path.isdir(p):
|
||||||
return p
|
return p
|
||||||
else:
|
else:
|
||||||
loc = QStandardPaths.writableLocation(QStandardPaths.DocumentsLocation)
|
loc = QStandardPaths.writableLocation(QStandardPaths.DocumentsLocation)
|
||||||
|
@ -121,7 +121,7 @@ a flash drive.""" % self.base)
|
||||||
def maybeMigrateFolder(self):
|
def maybeMigrateFolder(self):
|
||||||
oldBase = self._oldFolderLocation()
|
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)
|
shutil.move(oldBase, self.base)
|
||||||
|
|
||||||
# Profile load/save
|
# Profile load/save
|
||||||
|
|
Loading…
Reference in a new issue