summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2021-11-15 23:49:09 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2021-11-15 23:49:09 +0100
commita950cd638a1bec64d17531d4fbf8293bb7610925 (patch)
tree60e3712de529c358d355ee3caaa84a7b6458ef6a
parente2d48674b108e02c4e0f59306dae5afd70b6186d (diff)
Avoid redefining function exit
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
-rw-r--r--cameltris/screens/in_game.py4
-rw-r--r--cameltris/screens/pause.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/cameltris/screens/in_game.py b/cameltris/screens/in_game.py
index 840c0b9..469bdfd 100644
--- a/cameltris/screens/in_game.py
+++ b/cameltris/screens/in_game.py
@@ -36,10 +36,10 @@ class InGame(Screen):
self.screen: pygame.surface.Surface = screen
self.event_handler: dict[int, Callable[[pygame.event.Event], None]] = {}
- def exit(_) -> NoReturn:
+ def exit_(_) -> NoReturn:
sys.exit()
- self.event_handler[pygame.QUIT] = exit
+ self.event_handler[pygame.QUIT] = exit_
self.event_handler[pygame.KEYDOWN] = partial(handle_input_pressed, KeyboardController, self.players)
self.event_handler[pygame.KEYUP] = partial(handle_input_released, KeyboardController, self.players)
self.event_handler[pygame.JOYBUTTONDOWN] = partial(handle_input_pressed, JoystickController, self.players)
diff --git a/cameltris/screens/pause.py b/cameltris/screens/pause.py
index 72ff51a..c8e6c69 100644
--- a/cameltris/screens/pause.py
+++ b/cameltris/screens/pause.py
@@ -18,10 +18,10 @@ class Pause(Screen):
def __init__(self, screen: pygame.surface.Surface):
self.event_handler: dict[int, Callable[[pygame.event.Event], None]] = {}
- def exit(_) -> NoReturn:
+ def exit_(_) -> NoReturn:
sys.exit()
- self.event_handler[pygame.QUIT] = exit
+ self.event_handler[pygame.QUIT] = exit_
self.event_handler[pygame.JOYBUTTONDOWN] = lambda evt: handle_input_pressed(JoystickController(evt.joy), evt)
self.event_handler[pygame.KEYDOWN] = lambda evt: handle_input_pressed(KeyboardController(pygame.key), evt)