autodoc: Show full traceback and exception type in warnings

This commit is contained in:
Eric Wieser 2020-05-03 12:50:28 +01:00
parent f6b6d753d7
commit f3dd6c0bfa

View File

@ -397,8 +397,8 @@ class Documenter:
# retry without arguments for old documenters # retry without arguments for old documenters
args = self.format_args() args = self.format_args()
except Exception as err: except Exception as err:
logger.warning(__('error while formatting arguments for %s: %s') % logger.warning(__('error while formatting arguments for %s:') %
(self.fullname, err), type='autodoc') self.fullname, type='autodoc', exc_info=True)
args = None args = None
retann = self.retann retann = self.retann
@ -751,7 +751,7 @@ class Documenter:
# be cached anyway) # be cached anyway)
self.analyzer.find_attr_docs() self.analyzer.find_attr_docs()
except PycodeError as err: except PycodeError as err:
logger.debug('[autodoc] module analyzer failed: %s', err) logger.debug('[autodoc] module analyzer failed:', excinfo=True)
# no source file -- e.g. for builtin and C modules # no source file -- e.g. for builtin and C modules
self.analyzer = None self.analyzer = None
# at least add the module.__file__ as a dependency # at least add the module.__file__ as a dependency