summaryrefslogtreecommitdiff
path: root/pyparsing/actions.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-05-30 18:00:37 -0500
committerptmcg <ptmcg@austin.rr.com>2022-05-30 18:00:37 -0500
commitb89e92442a0140aa694f8f3bd5eea9fe83b552b5 (patch)
treea4a99e00e271c5213c9a6d583dd4f09d6f2b614e /pyparsing/actions.py
parent48168419f460287ab410bf3370a6828de9d837bb (diff)
downloadpyparsing-git-b89e92442a0140aa694f8f3bd5eea9fe83b552b5.tar.gz
Convert most str.format() calls to use f-strings
Diffstat (limited to 'pyparsing/actions.py')
-rw-r--r--pyparsing/actions.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pyparsing/actions.py b/pyparsing/actions.py
index 4808c84..8a91e1a 100644
--- a/pyparsing/actions.py
+++ b/pyparsing/actions.py
@@ -38,7 +38,7 @@ def match_only_at_col(n):
def verify_col(strg, locn, toks):
if col(locn, strg) != n:
- raise ParseException(strg, locn, "matched token not at column {}".format(n))
+ raise ParseException(strg, locn, f"matched token not at column {n}")
return verify_col
@@ -148,9 +148,7 @@ def with_attribute(*args, **attr_dict):
raise ParseException(
s,
l,
- "attribute {!r} has value {!r}, must be {!r}".format(
- attrName, tokens[attrName], attrValue
- ),
+ f"attribute {attrName!r} has value {tokens[attrName]!r}, must be {attrValue!r}",
)
return pa
@@ -195,7 +193,7 @@ def with_class(classname, namespace=""):
1 4 0 1 0
1,3 2,3 1,1
"""
- classattr = "{}:class".format(namespace) if namespace else "class"
+ classattr = f"{namespace}:class" if namespace else "class"
return with_attribute(**{classattr: classname})