summaryrefslogtreecommitdiff
path: root/pyparsing/exceptions.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@users.noreply.github.com>2020-07-19 01:27:26 -0500
committerPaul McGuire <ptmcg@users.noreply.github.com>2020-07-19 01:27:26 -0500
commit11cdffe3dff0449d7f49c90aaefb572c01ddb580 (patch)
tree21223cfbd9868020f4a43b26d19b880f6163378e /pyparsing/exceptions.py
parent31679fac4fb3811004e5dc09c1465d7117edc830 (diff)
downloadpyparsing-git-11cdffe3dff0449d7f49c90aaefb572c01ddb580.tar.gz
Replace last-century '%' string interp with .format() usage
Diffstat (limited to 'pyparsing/exceptions.py')
-rw-r--r--pyparsing/exceptions.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/pyparsing/exceptions.py b/pyparsing/exceptions.py
index 978e3d1..3a92fdf 100644
--- a/pyparsing/exceptions.py
+++ b/pyparsing/exceptions.py
@@ -119,12 +119,8 @@ class ParseBaseException(Exception):
)
else:
foundstr = ""
- return "%s%s (at char %d), (line:%d, col:%d)" % (
- self.msg,
- foundstr,
- self.loc,
- self.lineno,
- self.column,
+ return "{}{} (at char {}), (line:{}, col:{})".format(
+ self.msg, foundstr, self.loc, self.lineno, self.column
)
def __repr__(self):
@@ -245,4 +241,4 @@ class RecursiveGrammarException(Exception):
self.parseElementTrace = parseElementList
def __str__(self):
- return "RecursiveGrammarException: %s" % self.parseElementTrace
+ return "RecursiveGrammarException: {}".format(self.parseElementTrace)