summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-04-20 01:26:12 +0900
committerGitHub <noreply@github.com>2021-04-20 01:26:12 +0900
commit70e2def0c44d5143d1f32db227623ff7cbbbd33d (patch)
tree8846102ed481e96c47bae3879b38925dfc13075c
parent58ec5c4089a6aaa1c638741b8ebe38f627e0c1d1 (diff)
parentab75cc74cfd7496958a15ca074adb9489edd8a89 (diff)
downloadsphinx-git-70e2def0c44d5143d1f32db227623ff7cbbbd33d.tar.gz
Merge branch '4.0.x' into 9110_restify_GenericAlias
-rw-r--r--CHANGES2
-rw-r--r--doc/usage/extensions/autodoc.rst2
-rw-r--r--sphinx/ext/autodoc/importer.py9
-rw-r--r--sphinx/themes/basic/static/basic.css_t6
4 files changed, 16 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index f18c806e0..5edc80e38 100644
--- a/CHANGES
+++ b/CHANGES
@@ -17,8 +17,10 @@ Features added
--------------
* #8818: autodoc: Super class having ``Any`` arguments causes nit-picky warning
+* #9095: autodoc: TypeError is raised on processing broken metaclass
* #9110: autodoc: metadata of GenericAlias is not rendered as a reference in
py37+
+* #9098: html: copy-range protection for doctests doesn't work in Safari
* #9103: LaTeX: imgconverter: conversion runs even if not needed
* #8127: py domain: Ellipsis in info-field-list causes nit-picky warning
* #9023: More CSS classes on domain descriptions, see :ref:`nodes` for details.
diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst
index 1bfa8086c..da0ff7c99 100644
--- a/doc/usage/extensions/autodoc.rst
+++ b/doc/usage/extensions/autodoc.rst
@@ -563,7 +563,7 @@ There are also config values that you can set:
.. confval:: autodoc_typehints
- This value controls how to represents typehints. The setting takes the
+ This value controls how to represent typehints. The setting takes the
following values:
* ``'signature'`` -- Show typehints as its signature (default)
diff --git a/sphinx/ext/autodoc/importer.py b/sphinx/ext/autodoc/importer.py
index ebb60b38b..1a8ea0973 100644
--- a/sphinx/ext/autodoc/importer.py
+++ b/sphinx/ext/autodoc/importer.py
@@ -108,7 +108,14 @@ def import_object(modname: str, objpath: List[str], objtype: str = '',
logger.debug('[autodoc] getattr(_, %r)', attrname)
mangled_name = mangle(obj, attrname)
obj = attrgetter(obj, mangled_name)
- logger.debug('[autodoc] => %r', obj)
+
+ try:
+ logger.debug('[autodoc] => %r', obj)
+ except TypeError:
+ # fallback of failure on logging for broken object
+ # refs: https://github.com/sphinx-doc/sphinx/issues/9095
+ logger.debug('[autodoc] => %r', (obj,))
+
object_name = attrname
return [module, parent, object_name, obj]
except (AttributeError, ImportError) as exc:
diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t
index 25ab688e4..db43499ad 100644
--- a/sphinx/themes/basic/static/basic.css_t
+++ b/sphinx/themes/basic/static/basic.css_t
@@ -820,7 +820,11 @@ div.code-block-caption code {
table.highlighttable td.linenos,
span.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
- user-select: none;
+ user-select: none;
+ -webkit-user-select: text; /* Safari fallback only */
+ -webkit-user-select: none; /* Chrome/Safari */
+ -moz-user-select: none; /* Firefox */
+ -ms-user-select: none; /* IE10+ */
}
div.code-block-caption span.caption-number {