Skip to content

Commit 6325937

Browse files
committed
raise a warning instead of exception
1 parent 805c8a3 commit 6325937

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src_c/window.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,14 @@ window_set_always_on_top(pgWindowObject *self, PyObject *arg, void *v)
317317
return -1;
318318

319319
SDL_SetWindowAlwaysOnTop(self->_win, enable);
320-
321-
return 0;
322320
#else
323-
PyErr_SetString(pgExc_SDLError, "'always_on_top' requires SDL 2.0.16+");
324-
return -1;
321+
if (PyErr_WarnEx(PyExc_Warning,
322+
"Setting 'always_on_top' requires SDL 2.0.16+",
323+
1) == -1) {
324+
return -1;
325+
}
325326
#endif // SDL_VERSION_ATLEAST(2, 0, 16)
327+
return 0;
326328
}
327329

328330
static PyObject *

0 commit comments

Comments
 (0)