mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #3597: python domain raises UnboundLocalError if invalid name given
This commit is contained in:
parent
98e8fa992e
commit
57019c291a
2
CHANGES
2
CHANGES
@ -13,6 +13,8 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #3597: python domain raises UnboundLocalError if invalid name given
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -302,6 +302,7 @@ class PyObject(ObjectDescription):
|
||||
only the most recent object is tracked. This object prefix name will be
|
||||
removed with :py:meth:`after_content`.
|
||||
"""
|
||||
prefix = None
|
||||
if self.names:
|
||||
# fullname and name_prefix come from the `handle_signature` method.
|
||||
# fullname represents the full object name that is constructed using
|
||||
@ -312,8 +313,6 @@ class PyObject(ObjectDescription):
|
||||
prefix = fullname
|
||||
elif name_prefix:
|
||||
prefix = name_prefix.strip('.')
|
||||
else:
|
||||
prefix = None
|
||||
if prefix:
|
||||
self.env.ref_context['py:class'] = prefix
|
||||
if self.allow_nesting:
|
||||
|
Loading…
Reference in New Issue
Block a user