src/eric7/Tools/webBrowserSupport.py

branch
eric7
changeset 10331
c1a2ff7e3575
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
equal deleted inserted replaced
10330:5ea038882dd6 10331:c1a2ff7e3575
9 9
10 It looks for QtWebEngine. It reports the variant found or the string 'None' if 10 It looks for QtWebEngine. It reports the variant found or the string 'None' if
11 it is absent. 11 it is absent.
12 """ 12 """
13 13
14 import contextlib 14 import importlib
15 import sys 15 import sys
16 16
17 variant = "None" 17 variant = (
18 18 "QtWebEngine"
19 with contextlib.suppress(ImportError): 19 if (
20 from PyQt6 import QtWebEngineWidgets # __IGNORE_WARNING__ 20 bool(importlib.util.find_spec("PyQt6"))
21 21 and bool(importlib.util.find_spec("PyQt6.QtWebEngineWidgets"))
22 variant = "QtWebEngine" 22 )
23 23 else "None"
24 print(variant) # __IGNORE_WARNING_M801__ 24 )
25 print(variant) # noqa: M801
25 26
26 sys.exit(0) 27 sys.exit(0)

eric ide

mercurial