From b7632e01390a945a3b1f9963e7f9dd5753cb92a9 2023-02-28 22:35:32 From: Emilio Graff <1@emil.io> Date: 2023-02-28 22:35:32 Subject: [PATCH] BF: clear environment variable on error If the requested Qt version can't be loaded. --- diff --git a/IPython/external/qt_loaders.py b/IPython/external/qt_loaders.py index c900c8f..1486cf9 100644 --- a/IPython/external/qt_loaders.py +++ b/IPython/external/qt_loaders.py @@ -10,6 +10,7 @@ be accessed directly from the outside """ import importlib.abc import sys +import os import types from functools import partial, lru_cache import operator @@ -368,6 +369,10 @@ def load_qt(api_options): commit_api(api) return result else: + # Clear the environment variable since it doesn't work. + if "QT_API" in os.environ: + del os.environ["QT_API"] + raise ImportError( """ Could not load requested Qt binding. Please ensure that