Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 146872d

Browse files
committed
MNT: fix error message for invalid QT_API env
1 parent 8b4c2a7 commit 146872d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/backends/qt_compat.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@
6767
QT_API = _ETS[QT_API_ENV]
6868
except KeyError as err:
6969
raise RuntimeError(
70-
"The environment variable QT_API has the unrecognized value {!r};"
71-
"valid values are {}".format(
72-
QT_API, ", ".join(map(repr, _ETS)))) from None
70+
"The environment variable QT_API has the unrecognized value "
71+
f"{QT_API_ENV!r}; "
72+
f"valid values are {set(k for k in _ETS if k is not None)}"
73+
) from None
7374

7475

7576
def _setup_pyqt5plus():

0 commit comments

Comments
 (0)