From 89fc6437ddcd41626014fc30956126440a94e93f Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 20 Jun 2026 17:55:04 -0700 Subject: [PATCH] don't crash if rosetta is not available on macOS (#1366) * don't crash if rosetta is not available on macOS * make error a dialog * add newlines * fix format * modify strings --- kindlecomicconverter/KCC_gui.py | 5 +++++ kindlecomicconverter/comic2ebook.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/kindlecomicconverter/KCC_gui.py b/kindlecomicconverter/KCC_gui.py index 5cfa418..21b454a 100644 --- a/kindlecomicconverter/KCC_gui.py +++ b/kindlecomicconverter/KCC_gui.py @@ -1189,6 +1189,11 @@ class KCCGUI(KCC_ui.Ui_mainWindow): self.kindleGen = False if startup: self.display_kindlegen_missing() + except OSError as e: + self.kindleGen = False + if startup: + error = f"kindlegen: {e.strerror}\n\n Re-install Rosetta/Kindle Previewer/other Intel app?\n\nPlease email Amazon to make Kindle Previewer Apple silicon native at amazon.com/kindle-help" + self.showDialog(error, 'error') def __init__(self, kccapp, kccwindow): global APP, MW, GUI diff --git a/kindlecomicconverter/comic2ebook.py b/kindlecomicconverter/comic2ebook.py index 469812a..802c4eb 100755 --- a/kindlecomicconverter/comic2ebook.py +++ b/kindlecomicconverter/comic2ebook.py @@ -1673,6 +1673,11 @@ def checkTools(source): except (FileNotFoundError, CalledProcessError): print('ERROR: KindleGen is missing!') sys.exit(1) + except OSError as e: + print(f"kindlegen: {e.strerror}") + print('Re-install Rosetta/Kindle Previewer/other Intel app?') + print('Please email Amazon to make Kindle Previewer Apple silicon native at amazon.com/kindle-help') + sys.exit(1) def checkPre(source='KCC-'):