We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfaa76e commit a226185Copy full SHA for a226185
src_c/surface.c
@@ -1415,13 +1415,16 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
1415
Uint8 key_r, key_g, key_b, key_a = 255;
1416
int has_colorkey = SDL_FALSE;
1417
1418
- if (!SDL_WasInit(SDL_INIT_VIDEO))
1419
- return RAISE(pgExc_SDLError,
1420
- "cannot convert without pygame.display initialized");
1421
-
1422
if (!PyArg_ParseTuple(args, "|Oi", &argobject, &flags))
1423
return NULL;
1424
+
+ if (!argobject && !SDL_WasInit(SDL_INIT_VIDEO))
+ return RAISE(pgExc_SDLError,
+ "cannot convert without format "
1425
+ "when pygame.display is not initialized");
1426
1427
1428
SURF_INIT_CHECK(surf)
1429
1430
pgSurface_Prep(self);
0 commit comments