summaryrefslogtreecommitdiff
path: root/sphinx/transforms/post_transforms/code.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-09-25 00:10:59 +0100
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-09-25 00:10:59 +0100
commit9ced73631695890638a2d412ef3d916ec02d63e7 (patch)
tree2594d34743048635a336b8169c0c172e62b1987b /sphinx/transforms/post_transforms/code.py
parentcd24c541448e5945287c7d05413351482f3b1340 (diff)
downloadsphinx-git-9ced73631695890638a2d412ef3d916ec02d63e7.tar.gz
Fix highlighting lexers
- Ensure `pycon3` is always normalised to `pycon`
Diffstat (limited to 'sphinx/transforms/post_transforms/code.py')
-rw-r--r--sphinx/transforms/post_transforms/code.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/transforms/post_transforms/code.py b/sphinx/transforms/post_transforms/code.py
index 3c3f54328..5a5980c4a 100644
--- a/sphinx/transforms/post_transforms/code.py
+++ b/sphinx/transforms/post_transforms/code.py
@@ -109,9 +109,9 @@ class TrimDoctestFlagsTransform(SphinxTransform):
return False # skip parsed-literal node
language = node.get('language')
- if language in ('pycon', 'pycon3'):
+ if language in {'pycon', 'pycon3'}:
return True
- elif language in ('py', 'py3', 'python', 'python3', 'default'):
+ elif language in {'py', 'python', 'py3', 'python3', 'default'}:
return node.rawsource.startswith('>>>')
elif language == 'guess':
try: