mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1949: Use `safe_getattr
` in the coverage builder to avoid aborting with descriptors that have custom behavior.
This commit is contained in:
parent
21188120cc
commit
ae7e3afb4f
2
CHANGES
2
CHANGES
@ -30,6 +30,8 @@ Bugs fixed
|
|||||||
Hirai.
|
Hirai.
|
||||||
* #1871: Fix for LaTeX output of tables with one column and multirows.
|
* #1871: Fix for LaTeX output of tables with one column and multirows.
|
||||||
* Work around the lack of the HTMLParserError exception in Python 3.5.
|
* Work around the lack of the HTMLParserError exception in Python 3.5.
|
||||||
|
* #1949: Use ``safe_getattr`` in the coverage builder to avoid aborting with
|
||||||
|
descriptors that have custom behavior.
|
||||||
|
|
||||||
|
|
||||||
Release 1.3.1 (released Mar 17, 2015)
|
Release 1.3.1 (released Mar 17, 2015)
|
||||||
|
@ -20,6 +20,7 @@ from six.moves import cPickle as pickle
|
|||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
from sphinx.builders import Builder
|
from sphinx.builders import Builder
|
||||||
|
from sphinx.util.inspect import safe_getattr
|
||||||
|
|
||||||
|
|
||||||
# utility
|
# utility
|
||||||
@ -187,7 +188,10 @@ class CoverageBuilder(Builder):
|
|||||||
for attr_name in dir(obj):
|
for attr_name in dir(obj):
|
||||||
if attr_name not in obj.__dict__:
|
if attr_name not in obj.__dict__:
|
||||||
continue
|
continue
|
||||||
attr = getattr(obj, attr_name)
|
try:
|
||||||
|
attr = safe_getattr(obj, attr_name)
|
||||||
|
except AttributeError:
|
||||||
|
continue
|
||||||
if not (inspect.ismethod(attr) or
|
if not (inspect.ismethod(attr) or
|
||||||
inspect.isfunction(attr)):
|
inspect.isfunction(attr)):
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user