Files
nixpkgs/pkgs/development/python-modules/pygame/adapt-to-sdl3-format-message.patch
Marcin Serwin 99ecf06993 pygame: migrate to sdl2-compat
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2025-05-17 11:32:52 +02:00

15 lines
492 B
Diff

diff --git a/src_c/surface.c b/src_c/surface.c
index ee9991fb..32c007bd 100644
--- a/src_c/surface.c
+++ b/src_c/surface.c
@@ -733,7 +733,8 @@ _raise_create_surface_error(void)
{
const char *msg = SDL_GetError();
- if (strcmp(msg, "Unknown pixel format") == 0)
+ if (strcmp(msg, "Unknown pixel format") == 0 ||
+ strcmp(msg, "Parameter 'format' is invalid") == 0)
return RAISE(PyExc_ValueError, "Invalid mask values");
return RAISE(pgExc_SDLError, msg);
}