Skip to content

Commit

Permalink
pythongh-97740: Fix bang in Sphinx C domain ref target syntax
Browse files Browse the repository at this point in the history
Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
CAM-Gerlach and AA-Turner committed Oct 2, 2022
1 parent cac2e8a commit edda9dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,18 @@
# 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

0 comments on commit edda9dd

Please sign in to comment.