Skip to content

Commit 39a45ad

Browse files
committed
Expose ExtensionError in sphinx.util for backwards compatibility.
This will be removed in Sphinx 9, as exposing the exception in ``sphinx.util`` was never intentional. ``ExtensionError`` has been part of ``sphinx.errors`` since v0.9.
1 parent 5a4859a commit 39a45ad

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGES.rst

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Release 8.1.2 (in development)
44
Bugs fixed
55
----------
66

7+
* #13012: Expose :exc:`sphinx.errors.ExtensionError` in ``sphinx.util``
8+
for backwards compatibility.
9+
This will be removed in Sphinx 9, as exposing the exception
10+
in ``sphinx.util`` was never intentional.
11+
:exc:`!ExtensionError` has been part of ``sphinx.errors`` since Sphinx 0.9.
12+
Patch by Adam Turner.
713

814
Release 8.1.1 (released Oct 11, 2024)
915
=====================================

sphinx/util/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import re
99
from typing import Any
1010

11+
from sphinx.errors import ExtensionError as _ExtensionError
1112
from sphinx.errors import FiletypeNotFoundError
1213
from sphinx.util import _files, _importer, logging
1314
from sphinx.util import index_entries as _index_entries
@@ -86,6 +87,7 @@ def _sha1(data: bytes = b'', **_kw: Any) -> hashlib._Hash:
8687
'sphinx.util.index_entries.split_into',
8788
(9, 0),
8889
),
90+
'ExtensionError': (_ExtensionError, 'sphinx.errors.ExtensionError', (9, 0)),
8991
'md5': (_md5, '', (9, 0)),
9092
'sha1': (_sha1, '', (9, 0)),
9193
'import_object': (_importer.import_object, '', (10, 0)),

0 commit comments

Comments
 (0)