Skip to content

Commit

Permalink
format, update test error message
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpfeiffer committed May 5, 2024
1 parent a226185 commit b0a3432
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src_c/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1418,13 +1418,11 @@ surf_convert(pgSurfaceObject *self, PyObject *args)
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
2 changes: 1 addition & 1 deletion test/surface_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ def test_convert_init(self):
filename = example_path(os.path.join("data", "alien3.png")) # 8bit PNG
surf8bit = pygame.image.load(filename)

self.assertRaisesRegex(pygame.error, "display initialized", surf.convert)
self.assertRaisesRegex(pygame.error, "display is not initialized", surf.convert)

pygame.display.init()
try:
Expand Down

0 comments on commit b0a3432

Please sign in to comment.