Skip to content

Commit 730cde7

Browse files
committed
Fix ambiguous cross reference of type
Sphinx thinks this might be one of the Event attributes when it is actually a builtin type. Being more explicit seems to work for this simple case. Also switched `__exit__` parameters to be positional.
1 parent 4f8125e commit 730cde7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tcod/sdl/audio.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
from tcod.sdl._internal import _check, _check_float, _check_int, _check_p
5555

5656
if TYPE_CHECKING:
57+
import builtins
5758
from collections.abc import Callable, Hashable, Iterable, Iterator
5859
from types import TracebackType
5960

@@ -426,9 +427,10 @@ def __enter__(self) -> Self:
426427

427428
def __exit__(
428429
self,
429-
type: type[BaseException] | None, # noqa: A002
430-
value: BaseException | None,
431-
traceback: TracebackType | None,
430+
_type: builtins.type[BaseException] | None, # Explicit builtins prefix to disambiguate Sphinx cross-reference
431+
_value: BaseException | None,
432+
_traceback: TracebackType | None,
433+
/,
432434
) -> None:
433435
"""Close the device when exiting the context."""
434436
self.close()

0 commit comments

Comments
 (0)