Skip to content

Commit ec6cdd5

Browse files
committed
Suggest pysdl2-dll upgrade on Apple Silicon
1 parent 1475d4d commit ec6cdd5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

sdl2/dll.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
postpath = os.getenv('PYSDL2_DLL_PATH')
1818
if prepath != postpath:
1919
msg = "Using SDL2 binaries from pysdl2-dll {0}"
20-
prettywarn(msg.format(sdl2dll.__version__), UserWarning)
21-
if sys.platform == "darwin" and cpu_arch() == "arm64":
22-
msg = "The sdlimage, sdlmixer, and sdlgfx modules are currently\n"
23-
msg += "unavailable via py-sdl2 on ARM64 Macs. "
24-
msg += "If you require any of these\n"
25-
msg += "modules, please uninstall pysdl2-dll and install SDL2 "
26-
msg += "using Homebrew."
20+
vstr = sdl2dll.__version__
21+
prettywarn(msg.format(vstr), UserWarning)
22+
# Warn if on Apple Silicon and pysdl2-dll isn't fully native
23+
vernum = tuple([int(i) for i in vstr.split(".")[:3]])
24+
need_update = vernum <= (2, 0, 22) and "post" not in vstr
25+
if sys.platform == "darwin" and cpu_arch() == "arm64" and need_update:
26+
msg = "The installed version of pysdl2-dll does not fully support\n"
27+
msg += "Apple Silicon. Please update to the latest version for "
28+
msg += "full compatibility."
2729
prettywarn(msg.format(sdl2dll.__version__), UserWarning)
2830

2931
except ImportError:

0 commit comments

Comments
 (0)