From f95180349c5044f4cdcba17029a2b7c09d28a037 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Jan 2023 11:30:42 +0530 Subject: [PATCH] Delay load MobiReader --- .../devices/kindle/apnx_page_generator/i_page_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/devices/kindle/apnx_page_generator/i_page_generator.py b/src/calibre/devices/kindle/apnx_page_generator/i_page_generator.py index 124a606101..e815c904df 100644 --- a/src/calibre/devices/kindle/apnx_page_generator/i_page_generator.py +++ b/src/calibre/devices/kindle/apnx_page_generator/i_page_generator.py @@ -7,7 +7,6 @@ from abc import abstractmethod, ABCMeta from typing import Optional from calibre.devices.kindle.apnx_page_generator.pages import Pages -from calibre.ebooks.mobi.reader.mobi6 import MobiReader from calibre.utils.logging import default_log from polyglot.builtins import as_bytes from calibre.ebooks.pdb.header import PdbHeaderReader @@ -40,6 +39,7 @@ class IPageGenerator(metaclass=ABCMeta): def mobi_html(mobi_file_path: str) -> bytes: + from calibre.ebooks.mobi.reader.mobi6 import MobiReader mr = MobiReader(mobi_file_path, default_log) if mr.book_header.encryption_type != 0: raise Exception("DRMed book")