mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-93738: Disallow pre-v3 syntax in the C domain (#97962)
Also, disable using invalid sphinx-lint 0.6.2.
This commit is contained in:
parent
cd0fde27f9
commit
f612565bd3
7 changed files with 11 additions and 33 deletions
25
Doc/conf.py
25
Doc/conf.py
|
@ -239,28 +239,3 @@ linkcheck_ignore = [r'https://bugs.python.org/(issue)?\d+']
|
|||
# Relative filename of the data files
|
||||
refcount_file = 'data/refcounts.dat'
|
||||
stable_abi_file = 'data/stable_abi.dat'
|
||||
|
||||
# Sphinx 2 and Sphinx 3 compatibility
|
||||
# -----------------------------------
|
||||
|
||||
# bpo-40204: Allow Sphinx 2 syntax in the C domain
|
||||
c_allow_pre_v3 = True
|
||||
|
||||
# bpo-40204: Disable warnings on Sphinx 2 syntax of the C domain since the
|
||||
# documentation is built with -W (warnings treated as errors).
|
||||
c_warn_on_allowed_pre_v3 = False
|
||||
|
||||
# Fix '!' not working with C domain when pre_v3 is enabled
|
||||
import sphinx
|
||||
|
||||
if sphinx.version_info[:2] < (5, 3):
|
||||
from sphinx.domains.c import CXRefRole
|
||||
|
||||
original_run = CXRefRole.run
|
||||
|
||||
def new_run(self):
|
||||
if self.disabled:
|
||||
return super(CXRefRole, self).run()
|
||||
return original_run(self)
|
||||
|
||||
CXRefRole.run = new_run
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue