Skip to content

Commit

Permalink
relax convert conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpfeiffer committed Apr 22, 2024
1 parent dfaa76e commit a226185
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,13 +1415,16 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
Uint8 key_r, key_g, key_b, key_a = 255;
int has_colorkey = SDL_FALSE;

if (!SDL_WasInit(SDL_INIT_VIDEO))
return RAISE(pgExc_SDLError,
"cannot convert without pygame.display initialized");

if (!PyArg_ParseTuple(args, "|Oi", &argobject, &flags))
return NULL;


if (!argobject && !SDL_WasInit(SDL_INIT_VIDEO))
return RAISE(pgExc_SDLError,
"cannot convert without format "
"when pygame.display is not initialized");


SURF_INIT_CHECK(surf)

pgSurface_Prep(self);
Expand Down

0 comments on commit a226185

Please sign in to comment.