View Single Post
Old 12-12-2022, 09:50 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,597
Karma: 23164939
Join Date: Dec 2010
Device: Kindle PW2
How to best handle import Pyside import errors

I've created a simple plugin that requires PySide.QWebEngineView, which isn't available in PyQt5. What's the most elegant way to handle Pyside import errors?

The following code works, but I'm also getting an Error Parsing Result XML. Start tag expected. error message.

Code:
import sys
try:
    from PySide.QtWebEngineWidgets import QWebEngineView
    # more PySide imports
except ModuleNotFoundError:
    print('This plugin requires PySide.')
    sys.exit()
Is there an easy way to suppress the Error Parsing Result XML. Start tag expected. error message?

Last edited by Doitsu; 12-12-2022 at 09:52 AM.
Doitsu is offline   Reply With Quote