diff --git a/couchpotato/core/_base/updater/main.py b/couchpotato/core/_base/updater/main.py index 1ef2b000..6e9236f6 100644 --- a/couchpotato/core/_base/updater/main.py +++ b/couchpotato/core/_base/updater/main.py @@ -135,5 +135,13 @@ class Updater(Plugin): except: log.error('Couldn\'t remove %s: %s' % (full_path, traceback.format_exc())) + for dir_name in dirs: + full_path = os.path.join(root, dir_name) + if len(os.listdir(full_path)) == 0: + try: + os.rmdir(full_path) + except: + log.error('Couldn\'t remove empty directory %s: %s' % (full_path, traceback.format_exc())) + def isEnabled(self): return super(Updater, self).isEnabled() and Env.get('uses_git') diff --git a/couchpotato/core/loader.py b/couchpotato/core/loader.py index 4092c056..edf928e6 100644 --- a/couchpotato/core/loader.py +++ b/couchpotato/core/loader.py @@ -51,7 +51,9 @@ class Loader(object): did_save += self.loadSettings(m, module_name, save = False) self.loadPlugins(m, plugin.get('name')) - except Exception, e: + except ImportError: + log.debug('Import error, remove the empty folder: %s' % plugin.get('module')) + except: log.error('Can\'t import %s: %s' % (module_name, traceback.format_exc())) if did_save: