Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Disallow pre-v3 syntax in the C domain
  • Loading branch information
AA-Turner committed Oct 6, 2022
commit 29e805494449a6fae1bed973fc3b3f884950180d
25 changes: 0 additions & 25 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,28 +239,3 @@
# 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