From bf575bf881ad222bec2d5c7880c4a5b34b301672 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Thu, 31 Aug 2023 23:24:11 +0200 Subject: [PATCH] fix session not being closed --- hn.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hn.py b/hn.py index 2e78ca5..ff4103e 100755 --- a/hn.py +++ b/hn.py @@ -95,7 +95,7 @@ class Client: c = self.screen.getch() story = self.loadedstories[self.topstories[self.story_pos + self.cursor_pos]] if c == ord('q'): # Quit - self.exit() + await self.exit() elif c == curses.KEY_UP: self.cursor_pos -= 1 if self.cursor_pos < 0: @@ -168,8 +168,8 @@ class Client: self.draw() await self.handle_input() - def exit(self): - self.session.close() + async def exit(self): + await self.session.close() curses.endwin() import sys sys.exit(0)