Fix warning: Redefining built-in 'dir'

This commit is contained in:
Laurent Monin
2018-02-20 17:57:15 +01:00
parent 5bdc36e42c
commit a3503e8b7f

View File

@@ -242,10 +242,10 @@ class File(QtCore.QObject, Item):
return new_filename
@staticmethod
def _rmdir(dir):
def _rmdir(path):
junk_files = (".DS_Store", "desktop.ini", "Desktop.ini", "Thumbs.db")
if not set(os.listdir(dir)) - set(junk_files):
shutil.rmtree(dir, False)
if not set(os.listdir(path)) - set(junk_files):
shutil.rmtree(path, False)
else:
raise OSError