mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 06:07:11 -05:00
check for dirs when deleting empty
This commit is contained in:
parent
82ead398db
commit
992479de33
1 changed files with 1 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ def _upgrade(col, ver):
|
|||
# folder, so remove any empty files
|
||||
changed = False
|
||||
for f in os.listdir(col.media.dir()):
|
||||
if not os.path.getsize(f):
|
||||
if os.path.isfile(f) and not os.path.getsize(f):
|
||||
os.unlink(f)
|
||||
col.media.db.execute(
|
||||
"delete from log where fname = ?", f)
|
||||
|
|
|
|||
Loading…
Reference in a new issue