From 69f29969adcd97db8a1ab54ef2bbd5ec7f29a07e Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 13 Oct 2017 00:47:21 +0200 Subject: Improve some bare or redundant excepts --- poezio/plugin_manager.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'poezio/plugin_manager.py') diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py index 9e2a8084..8499cf51 100644 --- a/poezio/plugin_manager.py +++ b/poezio/plugin_manager.py @@ -266,17 +266,13 @@ class PluginManager(object): completion function that completes the name of the plugins, from all .py files in plugins_dir """ - try: - names = set() - for path_ in self.load_path: - try: - add = set(os.listdir(path_)) - names |= add - except: - pass - except OSError as e: - self.core.information('Completion failed: %s' % e, 'Error') - return False + names = set() + for path_ in self.load_path: + try: + add = set(os.listdir(path_)) + names |= add + except OSError: + pass plugins_files = [name[:-3] for name in names if name.endswith('.py') and name != '__init__.py' and not name.startswith('.')] plugins_files.sort() -- cgit v1.2.3