Skip to content

Commit 07c9b04

Browse files
committed
debug
1 parent 302fa27 commit 07c9b04

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pygame_gui/elements/ui_button.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from typing import Union, Tuple, Dict, Iterable, Callable, Optional, Any
2-
import warnings
32

43
import pygame
54

@@ -368,13 +367,13 @@ def bind(self, event:int, function:Callable = None):
368367
369368
"""
370369
if function is None:
371-
self.handler.pop(event)
370+
self.handler.pop(event, None)
372371
return
373372

374373
if callable(function):
375374
self.handler[event] = function
376375
else:
377-
warnings.warn(f"{function} are not callable", category=UserWarning)
376+
raise TypeError("Function to bind must be callable")
378377

379378
def on_event(self, event:int, data: Dict[str, Any]):
380379
"""

0 commit comments

Comments
 (0)