Skip to content

Commit 9f11b1d

Browse files
committed
Remove SDL version test
This check was rarely needed, with SDL automatically bundled and loaded it's almost never needed anymore.
1 parent 0aeaa18 commit 9f11b1d

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

‎tcod/cffi.py‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,8 @@
99
from pathlib import Path
1010
from typing import Any, Literal
1111

12-
import cffi
13-
1412
logger = logging.getLogger("tcod")
1513

16-
__sdl_version__ = ""
17-
18-
REQUIRED_SDL_VERSION = (3, 2, 0)
19-
20-
ffi_check = cffi.FFI()
21-
ffi_check.cdef(
22-
"""
23-
int SDL_GetVersion(void);
24-
"""
25-
)
26-
27-
28-
def verify_dependencies() -> None:
29-
"""Try to make sure dependencies exist on this system."""
30-
if sys.platform == "win32":
31-
lib_test: Any = ffi_check.dlopen("SDL3.dll") # Make sure SDL3.dll is here.
32-
int_version = lib_test.SDL_GetVersion() # Need to check this version.
33-
major = int_version // 1000000
34-
minor = (int_version // 1000) % 1000
35-
patch = int_version % 1000
36-
version_tuple = major, minor, patch
37-
if version_tuple < REQUIRED_SDL_VERSION:
38-
msg = f"Tried to load an old version of SDL {version_tuple!r}"
39-
raise RuntimeError(msg)
40-
4114

4215
def get_architecture() -> Literal["x86", "x64", "arm64"]:
4316
"""Return the Windows architecture."""
@@ -56,7 +29,6 @@ def get_sdl_version() -> str:
5629
os.environ["PATH"] = f"""{Path(__file__).parent / get_architecture()}{os.pathsep}{os.environ["PATH"]}"""
5730

5831

59-
verify_dependencies()
6032
from tcod._libtcod import ffi, lib # noqa: E402
6133

6234
__sdl_version__ = get_sdl_version()

0 commit comments

Comments
 (0)