mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add warnings when env.currmodule or env.currclass are used.
This commit is contained in:
parent
1fcef558fa
commit
ca4e62e47b
@ -707,13 +707,17 @@ class BuildEnvironment:
|
||||
|
||||
@property
|
||||
def currmodule(self):
|
||||
"""Backwards compatible alias."""
|
||||
return self.temp_data.get('py:module')
|
||||
"""Backwards compatible alias. Will be removed."""
|
||||
self.warn(self.docname, 'env.currmodule is being referenced by an '
|
||||
'extension; this API will be removed in the future')
|
||||
return self.ref_context.get('py:module')
|
||||
|
||||
@property
|
||||
def currclass(self):
|
||||
"""Backwards compatible alias."""
|
||||
return self.temp_data.get('py:class')
|
||||
"""Backwards compatible alias. Will be removed."""
|
||||
self.warn(self.docname, 'env.currclass is being referenced by an '
|
||||
'extension; this API will be removed in the future')
|
||||
return self.ref_context.get('py:class')
|
||||
|
||||
def new_serialno(self, category=''):
|
||||
"""Return a serial number, e.g. for index entry targets.
|
||||
|
Loading…
Reference in New Issue
Block a user