Skip to content

Commit a9a6b63

Browse files
committed
Do not error out if GUI libraries are missing.
Errors are postponed from the time of importing `ScrollableContainers` to the time the user attempts to access `ScrollableContainers.MissingLibrary`.
1 parent c8a6fbb commit a9a6b63

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "ScrollableContainers"
7-
version = "1.1.1"
7+
version = "1.1.2"
88
authors = [
99
{ name="Vishal Pankaj Chandratreya" },
1010
]

src/ScrollableContainers/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from .Qt5 import *
2-
from .Qt6 import *
3-
from .Tk import *
4-
from .Wx import *
1+
for module in ('.Qt5', '.Qt6', '.Tk', '.Wx'):
2+
try:
3+
exec(f'from {module} import *')
4+
except ImportError:
5+
pass

0 commit comments

Comments
 (0)