diff --git a/TermTk/TTkWidgets/TTkModelView/__init__.py b/TermTk/TTkWidgets/TTkModelView/__init__.py index e841561a..23a9e97d 100644 --- a/TermTk/TTkWidgets/TTkModelView/__init__.py +++ b/TermTk/TTkWidgets/TTkModelView/__init__.py @@ -1,3 +1,5 @@ +from importlib.util import find_spec + from .tree import * from .treewidget import * from .treewidgetitem import * @@ -9,4 +11,6 @@ from .tablewidgetitem import * from .tablemodellist import * from .tablemodelcsv import * -from .tablemodelsqlite3 import * + +if find_spec('sqlite3'): + from .tablemodelsqlite3 import * diff --git a/tools/check.import.sh b/tools/check.import.sh index e5edd082..be5198d1 100755 --- a/tools/check.import.sh +++ b/tools/check.import.sh @@ -89,6 +89,7 @@ __check(){ -e "TTkTerminal/__init__.py:import importlib.util" \ -e "TTkTerminal/__init__.py:import platform" | grep -v \ + -e "TTkModelView/__init__.py:from importlib.util import find_spec" \ -e "TTkModelView/tablemodelcsv.py:import csv" \ -e "TTkModelView/tablemodelsqlite3.py:import sqlite3" \ -e "TTkModelView/tablemodelsqlite3.py:import threading"