Skip to content

Commit 026ed2e

Browse files
committed
Use pre-set exceptions in Joystick.set_led and Controller.set_led
1 parent bac234e commit 026ed2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src_c/_sdl2/controller.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ controller_set_led(pgControllerObject *self, PyObject *arg)
396396
Uint8 colors[4] = {0, 0, 0, 0};
397397

398398
if (!pg_RGBAFromObjEx(arg, colors, PG_COLOR_HANDLE_ALL)) {
399-
return RAISE(PyExc_TypeError,
400-
"set_led must be passed in a Color-compatible argument");
399+
// Exception already set
400+
return NULL;
401401
}
402402

403403
#if !SDL_VERSION_ATLEAST(3, 0, 0)

src_c/joystick.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,8 @@ joy_set_led(PyObject *self, PyObject *arg)
544544
Uint8 colors[4] = {0, 0, 0, 0};
545545

546546
if (!pg_RGBAFromObjEx(arg, colors, PG_COLOR_HANDLE_ALL)) {
547-
return RAISE(PyExc_TypeError,
548-
"set_led must be passed in a Color-compatible argument");
547+
// Exception already set
548+
return NULL;
549549
}
550550

551551
#if !SDL_VERSION_ATLEAST(3, 0, 0)

0 commit comments

Comments
 (0)