diff -r bf174ac41631 -r dd907ee33b03 src/eric7/Project/Project.py --- a/src/eric7/Project/Project.py Wed Dec 21 10:54:29 2022 +0100 +++ b/src/eric7/Project/Project.py Wed Dec 21 11:24:45 2022 +0100 @@ -1764,18 +1764,13 @@ @param langFile the translation file to be removed (string) """ - try: - from send2trash import send2trash as s2t # __IGNORE_WARNING_I10__ - except ImportError: - s2t = os.remove - langFile = self.getRelativePath(langFile) qmFile = self.__binaryTranslationFile(langFile) try: fn = os.path.join(self.ppath, langFile) if os.path.exists(fn): - s2t(fn) + os.remove(fn) except OSError as err: EricMessageBox.critical( self.ui, @@ -1801,7 +1796,7 @@ ) fn = os.path.join(self.ppath, qmFile) if os.path.exists(fn): - s2t(fn) + os.remove(fn) except OSError as err: EricMessageBox.critical( self.ui, @@ -2374,27 +2369,22 @@ @return flag indicating success (boolean) """ try: - from send2trash import send2trash as s2t # __IGNORE_WARNING_I10__ - except ImportError: - s2t = os.remove - - try: - s2t(os.path.join(self.ppath, fn)) + os.remove(os.path.join(self.ppath, fn)) path, ext = os.path.splitext(fn) if ext == ".ui": fn2 = os.path.join(self.ppath, "{0}.h".format(fn)) if os.path.isfile(fn2): - s2t(fn2) + os.remove(fn2) head, tail = os.path.split(path) for ext in [".pyc", ".pyo"]: fn2 = os.path.join(self.ppath, path + ext) if os.path.isfile(fn2): - s2t(fn2) + os.remove(fn2) pat = os.path.join( self.ppath, head, "__pycache__", "{0}.*{1}".format(tail, ext) ) for f in glob.glob(pat): - s2t(f) + os.remove(f) except OSError as err: EricMessageBox.critical( self.ui, @@ -2421,12 +2411,7 @@ if not os.path.isabs(dn): dn = os.path.join(self.ppath, dn) try: - try: - from send2trash import send2trash # __IGNORE_WARNING_I10__ - - send2trash(dn) - except ImportError: - shutil.rmtree(dn, True) + shutil.rmtree(dn, True) except OSError as err: EricMessageBox.critical( self.ui,