We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a220e1f commit 0d995d4Copy full SHA for 0d995d4
lib/matplotlib/__init__.py
@@ -1373,9 +1373,18 @@ def tk_window_focus():
1373
if s.startswith(str('-d')) and len(s) > 2: # look for a -d flag
1374
try:
1375
use(s[2:])
1376
+ break
1377
except (KeyError, ValueError):
1378
pass
1379
# we don't want to assume all -d flags are backends, e.g., -debug
1380
+else:
1381
+ # no backend selected from the command line, so we check the environment
1382
+ # variable MPL_BACKEND
1383
+ if 'MPL_BACKEND' in os.environ:
1384
+ try:
1385
+ use(os.environ['MPL_BACKEND'])
1386
+ except (KeyError, ValueError):
1387
+ pass
1388
1389
default_test_modules = [
1390
'matplotlib.tests.test_agg',
0 commit comments