From e30333f5eb4262069a8863e8fa276ecbcd364660 Mon Sep 17 00:00:00 2001 From: Paul McGuire Date: Mon, 8 Jul 2019 06:21:54 -0500 Subject: Nicer looking found string if fail on backslash --- pyparsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pyparsing.py') diff --git a/pyparsing.py b/pyparsing.py index eabfead..d41ceba 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -294,7 +294,7 @@ class ParseBaseException(Exception): if self.loc >= len(self.pstr): foundstr = ', found end of text' else: - foundstr = ', found %r' % self.pstr[self.loc:self.loc+1] + foundstr = (', found %r' % self.pstr[self.loc:self.loc+1]).replace(r'\\', '\\') else: foundstr = '' return "%s%s (at char %d), (line:%d, col:%d)" % \ -- cgit v1.2.1