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

Skip to content

Commit cfb2d3d

Browse files
committed
Warn if MPLBACKEND is invalid.
I could be convinced to make this an error actually.
1 parent 3590ce2 commit cfb2d3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,9 @@ def tk_window_focus():
14601460
# variable MPLBACKEND
14611461
try:
14621462
use(os.environ['MPLBACKEND'])
1463-
except (KeyError, ValueError):
1463+
except ValueError as e:
1464+
warnings.warn(str(e)) # Invalid backend.
1465+
except KeyError:
14641466
pass
14651467

14661468

0 commit comments

Comments
 (0)