Fix import (#9945)

This commit is contained in:
William FH 2023-08-29 12:38:42 -07:00 committed by GitHub
parent 8bd7a9d18e
commit fbd792ac7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,7 @@ class IMessageChatLoader(chat_loaders.BaseChatLoader):
if not self.db_path.exists(): if not self.db_path.exists():
raise FileNotFoundError(f"File {self.db_path} not found") raise FileNotFoundError(f"File {self.db_path} not found")
try: try:
pass # type: ignore import sqlite3 # noqa: F401
except ImportError as e: except ImportError as e:
raise ImportError( raise ImportError(
"The sqlite3 module is required to load iMessage chats.\n" "The sqlite3 module is required to load iMessage chats.\n"
@ -93,6 +93,7 @@ class IMessageChatLoader(chat_loaders.BaseChatLoader):
Yields: Yields:
ChatSession: Loaded chat session. ChatSession: Loaded chat session.
""" """
import sqlite3
try: try:
conn = sqlite3.connect(self.db_path) conn = sqlite3.connect(self.db_path)