diff -r 82b608e352ec -r 2bbec88047dd eric6/PluginManager/PluginRepositoryDialog.py --- a/eric6/PluginManager/PluginRepositoryDialog.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/PluginManager/PluginRepositoryDialog.py Wed Apr 21 19:40:50 2021 +0200 @@ -935,14 +935,13 @@ for pluginName in downloads: downloads[pluginName].sort(key=lambda x: x[1]) - if ( - pluginName in hiddenPlugins and - not Preferences.getPluginManager("KeepHidden") - ): - removeFiles = [f[0] for f in downloads[pluginName]] - else: - removeFiles = [f[0] for f in downloads[pluginName][ + removeFiles = ( + [f[0] for f in downloads[pluginName]] + if (pluginName in hiddenPlugins and + not Preferences.getPluginManager("KeepHidden")) else + [f[0] for f in downloads[pluginName][ :-Preferences.getPluginManager("KeepGenerations")]] + ) for removeFile in removeFiles: try: os.remove(os.path.join(downloadPath, removeFile))