Skip to content

Commit ad556e1

Browse files
committed
The ansi extension is only on 3.10+. Note this in changes and fix the test that assumed it.
1 parent 872b45b commit ad556e1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGES.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
=================
77

88
- Reintroduce ANSI output integration through the
9-
``programoutput_use_ansi`` configuration value. When enabled, command
10-
output is emitted as an ANSI-aware literal block for processing by the
11-
``erbsland.sphinx.ansi`` extension.
9+
``programoutput_use_ansi`` configuration value. When enabled,
10+
command output is emitted as an ANSI-aware literal block for
11+
processing by the `erbsland.sphinx.ansi
12+
<https://pypi.org/project/erbsland-sphinx-ansi/>`_ extension. Note
13+
that this extension and thus ANSI support is only available on
14+
Python 3.10 and newer.
1215

1316

1417
0.18 (2024-12-06)

src/sphinxcontrib/programoutput/tests/test_directive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ def test_use_ansi_missing_extension(self):
487487
.. program-output:: python -c 'print("\\x1b[31mspam\\x1b[0m")'""",
488488
programoutput_use_ansi=True,
489489
extensions=['sphinxcontrib.programoutput', 'erbsland.sphinx.ansi'])
490+
@unittest.skipIf(sys.version_info[:2] < (3, 10),
491+
"The extension is only available on 3.10+")
490492
def test_use_ansi_enabled_extension(self):
491493
with Patch('sphinxcontrib.programoutput.logger.warning') as patch_warning:
492494
doctree = self.doctree

0 commit comments

Comments
 (0)