From 11cdffe3dff0449d7f49c90aaefb572c01ddb580 Mon Sep 17 00:00:00 2001 From: Paul McGuire Date: Sun, 19 Jul 2020 01:27:26 -0500 Subject: Replace last-century '%' string interp with .format() usage --- pyparsing/exceptions.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'pyparsing/exceptions.py') 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) -- cgit v1.2.1