Skip to content

Commit c2730be

Browse files
timhoffmtacaswell
andauthored
Update lib/matplotlib/backends/backend_pgf.py
Co-authored-by: Thomas A Caswell <tcaswell@gmail.com>
1 parent e354866 commit c2730be

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/matplotlib/backends/backend_pgf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def _metadata_to_str(key, value):
156156
value = str(value)
157157

158158
invalid_chars = r"\{}[]()"
159-
if any(c in value for c in invalid_chars):
159+
if any(c in value + key for c in invalid_chars):
160160
raise ValueError(
161161
f"Invalid metadata value for {key!r}: {value!r}. "
162162
f"The value must not contain the chars {invalid_chars}.")

0 commit comments

Comments
 (0)