Skip to content

Commit

Permalink
Harmonise references to Sphinx versions (#11361)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 27, 2023
1 parent 8dd44d1 commit 616ba29
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions sphinx/application.py
Expand Up @@ -1119,8 +1119,9 @@ def add_lexer(self, alias: str, lexer: type[Lexer]) -> None:
.. versionadded:: 0.6
.. versionchanged:: 2.1
Take a lexer class as an argument. An instance of lexers are
still supported until Sphinx-3.x.
Take a lexer class as an argument.
.. versionchanged:: 4.0
Removed support for lexer instances as an argument.
"""
logger.debug('[app] adding lexer: %r', (alias, lexer))
lexer_classes[alias] = lexer
Expand Down
2 changes: 1 addition & 1 deletion sphinx/domains/python.py
Expand Up @@ -1368,7 +1368,7 @@ def resolve_xref(self, env: BuildEnvironment, fromdocname: str, builder: Builder
type, searchmode)

if not matches and type == 'attr':
# fallback to meth (for property; Sphinx-2.4.x)
# fallback to meth (for property; Sphinx 2.4.x)
# this ensures that `:attr:` role continues to refer to the old property entry
# that defined by ``method`` directive in old reST files.
matches = self.find_obj(env, modname, clsname, target, 'meth', searchmode)
Expand Down
4 changes: 2 additions & 2 deletions sphinx/ext/intersphinx.py
Expand Up @@ -360,10 +360,10 @@ def _resolve_reference_in_domain(env: BuildEnvironment,
) -> nodes.reference | None:
# we adjust the object types for backwards compatibility
if domain.name == 'std' and 'cmdoption' in objtypes:
# until Sphinx-1.6, cmdoptions are stored as std:option
# cmdoptions were stored as std:option until Sphinx 1.6
objtypes.append('option')
if domain.name == 'py' and 'attribute' in objtypes:
# Since Sphinx-2.1, properties are stored as py:method
# properties are stored as py:method since Sphinx 2.1
objtypes.append('method')

# the inventory contains domain:type as objtype
Expand Down

0 comments on commit 616ba29

Please sign in to comment.