mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -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
|
# folder, so remove any empty files
|
||||||
changed = False
|
changed = False
|
||||||
for f in os.listdir(col.media.dir()):
|
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)
|
os.unlink(f)
|
||||||
col.media.db.execute(
|
col.media.db.execute(
|
||||||
"delete from log where fname = ?", f)
|
"delete from log where fname = ?", f)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue