8000 Merge pull request #17392 from anntzer/preamblewarning · matplotlib/matplotlib@bb8480b · GitHub
[go: up one dir, main page]

Skip to content

Commit bb8480b

Browse files
authored
Merge pull request #17392 from anntzer/preamblewarning
Clarify deprecation message re: tex/pgf preambles as list-of-strings.
2 parents 54bd6f1 + ee52f21 commit bb8480b

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,21 @@ def validate_bool_maybe_none(b):
170170

171171

172172
def _validate_tex_preamble(s):
173-
message = (
174-
f"Support for setting the 'text.latex.preamble' and 'pgf.preamble' "
175-
f"rcParams to {s!r} is deprecated since %(since)s and will be "
176-
f"removed %(removal)s; please set them to plain (possibly empty) "
177-
f"strings instead.")
178173
if s is None or s == 'None':
179-
cbook.warn_deprecated("3.3", message=message)
174+
cbook.warn_deprecated(
175+
"3.3", message="Support for setting the 'text.latex.preamble' or "
176+
"'pgf.preamble' rcParam to None is deprecated since %(since)s and "
177+
"will be removed %(removal)s; set it to an empty string instead.")
180178
return ""
181179
try:
182180
if isinstance(s, str):
183181
return s
184182
elif np.iterable(s):
185-
cbook.warn_deprecated("3.3", message=message)
183+
cbook.warn_deprecated(
184+
"3.3", message="Support for setting the 'text.latex.preamble' "
185+
"or 'pgf.preamble' rcParam to a list of strings is deprecated "
186+
"since %(since)s and will be removed %(removal)s; set it to a "
187+
"single string instead.")
186188
return '\n'.join(s)
187189
else:
188190
raise TypeError

0 commit comments

Comments
 (0)
0