mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4993 from tk0miya/4946_pydomain_None_type
Fix #4946: py domain: type field could not handle "None" as a type
This commit is contained in:
commit
679002c483
1
CHANGES
1
CHANGES
@ -32,6 +32,7 @@ Bugs fixed
|
||||
LaTeX engine crashed
|
||||
* #4978: latex: shorthandoff is not set up for Brazil locale
|
||||
* #4928: i18n: Ignore dot-directories like .git/ in LC_MESSAGES/
|
||||
* #4946: py domain: type field could not handle "None" as a type
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
@ -156,7 +156,15 @@ class PyGroupedField(PyXrefMixin, GroupedField):
|
||||
|
||||
|
||||
class PyTypedField(PyXrefMixin, TypedField):
|
||||
pass
|
||||
def make_xref(self, rolename, domain, target,
|
||||
innernode=nodes.emphasis, contnode=None, env=None):
|
||||
# type: (unicode, unicode, unicode, nodes.Node, nodes.Node, BuildEnvironment) -> nodes.Node # NOQA
|
||||
if rolename == 'class' and target == 'None':
|
||||
# None is not a type, so use obj role instead.
|
||||
rolename = 'obj'
|
||||
|
||||
return super(PyTypedField, self).make_xref(rolename, domain, target,
|
||||
innernode, contnode, env)
|
||||
|
||||
|
||||
class PyObject(ObjectDescription):
|
||||
|
Loading…
Reference in New Issue
Block a user