diff options
author | benadha <benawiadha@gmail.com> | 2022-01-08 10:37:48 +0700 |
---|---|---|
committer | benadha <benawiadha@gmail.com> | 2022-01-08 10:37:48 +0700 |
commit | 0f98e2140f3fb9f3850674351f0fcc416dfa00b9 (patch) | |
tree | ca94e6781dd918d4e97a6e9f5d781bc118fc735c | |
parent | c0bfec3da1c55ae11a991a89938261c4e93ce795 (diff) | |
download | epy-0f98e2140f3fb9f3850674351f0fcc416dfa00b9.tar.gz |
Cleanup on failed ebook initialization
-rwxr-xr-x | epy.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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: |