diff --git a/aqt/profiles.py b/aqt/profiles.py index 9f6add370..2ec5b71eb 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -14,6 +14,7 @@ from anki.lang import langs from aqt.utils import showWarning from aqt import appHelpSite import aqt.forms +from send2trash import send2trash metaConf = dict( ver=0, @@ -120,7 +121,9 @@ documentation for information on using a flash drive.""") self.db.commit() def remove(self, name): - shutil.rmtree(self.profileFolder()) + p = self.profileFolder() + if os.path.exists(p): + send2trash(p) self.db.execute("delete from profiles where name = ?", name.encode("utf8")) self.db.commit()