fix some over-broad except: clauses

This commit is contained in:
Georg Brandl 2015-05-18 14:29:02 +02:00
parent 55368daa91
commit c6b99be46c
4 changed files with 4 additions and 6 deletions

View File

@ -449,7 +449,7 @@ class Sphinx(object):
try:
if not ext_meta.get('version'):
ext_meta['version'] = 'unknown version'
except:
except Exception:
ext_meta = {'version': 'unknown version'}
self._extensions[extension] = mod
self._extension_metadata[extension] = ext_meta

View File

@ -371,7 +371,7 @@ def _skip_member(app, what, name, obj, skip, options):
cls = functools.reduce(getattr, mod_path, mod)
else:
cls = obj.__globals__[cls_path]
except:
except Exception:
cls_is_owner = False
else:
cls_is_owner = (cls and hasattr(cls, name) and

View File

@ -218,7 +218,7 @@ def load_theme_plugins():
func_or_path = plugin.load()
try:
path = func_or_path()
except:
except Exception:
path = func_or_path
if isinstance(path, string_types):

View File

@ -33,9 +33,7 @@ def get_terminal_width():
struct.pack('hhhh', 0, 0, 0, 0))
height, width = struct.unpack('hhhh', call)[:2]
terminal_width = width
except (SystemExit, KeyboardInterrupt):
raise
except:
except Exception:
# FALLBACK
terminal_width = int(os.environ.get('COLUMNS', 80)) - 1
return terminal_width