Skip to content

Commit 1ad1c5e

Browse files
committed
Don't report faulty mplstyle when ISOLATED
Report them anyway if DEBUG
1 parent 36ec551 commit 1ad1c5e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stagpy/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ def load_mplstyle():
6868
plt = importlib.import_module('matplotlib.pyplot')
6969
if conf.plot.mplstyle:
7070
for style in conf.plot.mplstyle.split():
71-
stfile = config.CONFIG_DIR / (style + '.mplstyle')
72-
if stfile.is_file():
73-
style = str(stfile)
74-
if ISOLATED:
75-
break
71+
if not ISOLATED:
72+
stfile = config.CONFIG_DIR / (style + '.mplstyle')
73+
if stfile.is_file():
74+
style = str(stfile)
7675
try:
7776
plt.style.use(style)
7877
except OSError:
79-
print('Cannot import style {}.'.format(style),
80-
file=sys.stderr)
78+
if not ISOLATED or DEBUG:
79+
print('Cannot import style {}.'.format(style),
80+
file=sys.stderr)
8181
conf.plot.mplstyle = ''
8282
if conf.plot.xkcd:
8383
plt.xkcd()

0 commit comments

Comments
 (0)