summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2019-07-08 06:21:54 -0500
committerPaul McGuire <ptmcg@austin.rr.com>2019-07-08 06:21:54 -0500
commite30333f5eb4262069a8863e8fa276ecbcd364660 (patch)
tree39d5fa810c8fab2caad7b62f1ecae2f2bdc582ad
parent12fe989a000bb378bb237764f2c10dad43afc57c (diff)
downloadpyparsing-git-e30333f5eb4262069a8863e8fa276ecbcd364660.tar.gz
Nicer looking found string if fail on backslash
-rw-r--r--pyparsing.py2
1 files changed, 1 insertions, 1 deletions
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)" % \