eric6/Tools/webBrowserSupport.py

Thu, 15 Apr 2021 18:11:24 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 15 Apr 2021 18:11:24 +0200
changeset 8243
cc717c2ae956
parent 7923
91e843545d9a
permissions
-rw-r--r--

Applied some more code simplifications suggested by the new Simplify checker (Y105: use contextlib.suppress) (batch 2).

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# Copyright (c) 2018 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Script to determine the supported web browser variant.

It looks for QtWebEngine. It reports the variant found or the string 'None' if
it is absent.
"""

import sys
import contextlib

variant = "None"

with contextlib.suppress(ImportError):
    from PyQt5 import QtWebEngineWidgets    # __IGNORE_WARNING__
    variant = "QtWebEngine"

print(variant)      # __IGNORE_WARNING_M801__

sys.exit(0)

eric ide

mercurial