mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '3.x' into 8084_KeyError_for_broken_class
This commit is contained in:
commit
24f690c9e5
1
CHANGES
1
CHANGES
@ -37,6 +37,7 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #8074: napoleon: Crashes during processing C-ext module
|
||||
* #8084: autodoc: KeyError is raised on documenting an attribute of the broken
|
||||
class
|
||||
|
||||
|
@ -1074,7 +1074,10 @@ class NumpyDocstring(GoogleDocstring):
|
||||
super().__init__(docstring, config, app, what, name, obj, options)
|
||||
|
||||
def _get_location(self) -> str:
|
||||
filepath = inspect.getfile(self._obj) if self._obj is not None else None
|
||||
try:
|
||||
filepath = inspect.getfile(self._obj) if self._obj is not None else None
|
||||
except TypeError:
|
||||
filepath = None
|
||||
name = self._name
|
||||
|
||||
if filepath is None and name is None:
|
||||
|
@ -367,7 +367,14 @@ class SphinxComponentRegistry:
|
||||
logger.debug('[app] adding js_file: %r, %r', filename, attributes)
|
||||
self.js_files.append((filename, attributes))
|
||||
|
||||
def has_latex_package(self, name: str) -> bool:
|
||||
packages = self.latex_packages + self.latex_packages_after_hyperref
|
||||
return bool([x for x in packages if x[0] == name])
|
||||
|
||||
def add_latex_package(self, name: str, options: str, after_hyperref: bool = False) -> None:
|
||||
if self.has_latex_package(name):
|
||||
logger.warn("latex package '%s' already included" % name)
|
||||
|
||||
logger.debug('[app] adding latex package: %r', name)
|
||||
if after_hyperref:
|
||||
self.latex_packages_after_hyperref.append((name, options))
|
||||
|
@ -84,6 +84,8 @@ class LaTeXRenderer(SphinxRenderer):
|
||||
self.env.variable_end_string = '%>'
|
||||
self.env.block_start_string = '<%'
|
||||
self.env.block_end_string = '%>'
|
||||
self.env.comment_start_string = '<#'
|
||||
self.env.comment_end_string = '<#'
|
||||
|
||||
|
||||
class ReSTRenderer(SphinxRenderer):
|
||||
|
Loading…
Reference in New Issue
Block a user