mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix some over-broad except: clauses
This commit is contained in:
parent
55368daa91
commit
c6b99be46c
@ -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
|
||||
|
@ -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
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user