From 529146f3edffe6815ae86a694f7552fd3720196f Mon Sep 17 00:00:00 2001 From: Oscar Gustafsson Date: Sun, 15 Jan 2023 10:56:10 +0100 Subject: [PATCH] Suppress pyparsing warning Co-authored-by: Antony Lee --- lib/matplotlib/_fontconfig_pattern.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/matplotlib/_fontconfig_pattern.py b/lib/matplotlib/_fontconfig_pattern.py index efc1c9304f52..f0ed155c2d62 100644 --- a/lib/matplotlib/_fontconfig_pattern.py +++ b/lib/matplotlib/_fontconfig_pattern.py @@ -13,7 +13,7 @@ import re from pyparsing import ( - Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore) + Group, Optional, ParseException, Regex, StringEnd, Suppress, ZeroOrMore) from matplotlib import _api @@ -64,7 +64,7 @@ def comma_separated(elem): name = Regex(r"[a-z]+") value = Regex(r"([^%s]|(\\[%s]))*" % (_value_punc, _value_punc)) # replace trailing `| name` by oneOf(_CONSTANTS) in mpl 3.9. - prop = (name + Suppress("=") + comma_separated(value)) | name + prop = Group((name + Suppress("=") + comma_separated(value)) | name) return ( Optional(comma_separated(family)("families")) + Optional("-" + comma_separated(size)("sizes"))