Skip to content

Commit

Permalink
Expose ExtensionError in sphinx.util for backwards compatibil…
Browse files Browse the repository at this point in the history
…ity.

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.
  • Loading branch information
AA-Turner committed Oct 12, 2024
1 parent 5a4859a commit 39a45ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Release 8.1.2 (in development)
Bugs fixed
----------

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

Release 8.1.1 (released Oct 11, 2024)
=====================================
Expand Down
2 changes: 2 additions & 0 deletions sphinx/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re
from typing import Any

from sphinx.errors import ExtensionError as _ExtensionError
from sphinx.errors import FiletypeNotFoundError
from sphinx.util import _files, _importer, logging
from sphinx.util import index_entries as _index_entries
Expand Down Expand Up @@ -86,6 +87,7 @@ def _sha1(data: bytes = b'', **_kw: Any) -> hashlib._Hash:
'sphinx.util.index_entries.split_into',
(9, 0),
),
'ExtensionError': (_ExtensionError, 'sphinx.errors.ExtensionError', (9, 0)),
'md5': (_md5, '', (9, 0)),
'sha1': (_sha1, '', (9, 0)),
'import_object': (_importer.import_object, '', (10, 0)),
Expand Down

0 comments on commit 39a45ad

Please sign in to comment.