Skip to content

Commit 3c9da82

Browse files
committed
Extend namespace package support to tcod.sdl
In case any SDL tools such as audio mixing are put in another package. Fix typo.
1 parent 65ec5b9 commit 3c9da82

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changes relevant to the users of python-tcod are documented here.
44
This project adheres to [Semantic Versioning](https://semver.org/) since version `2.0.0`.
55

66
## [Unreleased]
7+
### Added
8+
- Added support for `tcod.sdl` namespace packages.
79

810
## [15.0.0] - 2023-01-04
911
### Changed

tcod/sdl/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from __future__ import annotations
22

33
import logging
4+
from pkgutil import extend_path
45
from typing import Any, Callable, Tuple, TypeVar
56

67
from tcod.loader import ffi, lib
78

9+
__path__ = extend_path(__path__, __name__)
10+
811
T = TypeVar("T")
912

1013
logger = logging.getLogger(__name__)
@@ -59,7 +62,7 @@ def _linked_version() -> Tuple[int, int, int]:
5962

6063

6164
def _version_at_least(required: Tuple[int, int, int]) -> None:
62-
"""Raise an error if the compiled version is less than required. Used to guard recentally defined SDL functions."""
65+
"""Raise an error if the compiled version is less than required. Used to guard recently defined SDL functions."""
6366
if required <= _compiled_version():
6467
return
6568
raise RuntimeError(

0 commit comments

Comments
 (0)