From 0f98e2140f3fb9f3850674351f0fcc416dfa00b9 Mon Sep 17 00:00:00 2001 From: benadha Date: Sat, 8 Jan 2022 10:37:48 +0700 Subject: Cleanup on failed ebook initialization --- epy.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epy.py b/epy.py index 54245f0..0df16e8 100755 --- a/epy.py +++ b/epy.py @@ -2180,7 +2180,8 @@ class Reader: self.ebook = ebook try: self.ebook.initialize() - except Exception as e: + except (KeyboardInterrupt, Exception) as e: + self.ebook.cleanup() if DEBUG: raise e else: -- cgit