24 lines
919 B
Diff
24 lines
919 B
Diff
|
From e0826a2ec69bc3cf71ba7ca7945774d9213d7d5e Mon Sep 17 00:00:00 2001
|
||
|
From: Kyle Sunden <git@ksunden.space>
|
||
|
Date: Wed, 5 Jul 2023 14:16:50 -0500
|
||
|
Subject: [PATCH] Limit error message overriding when
|
||
|
|
||
|
---
|
||
|
pyparsing/core.py | 3 ++-
|
||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/pyparsing/core.py b/pyparsing/core.py
|
||
|
index 8233f72c..bfbb391c 100644
|
||
|
--- a/pyparsing/core.py
|
||
|
+++ b/pyparsing/core.py
|
||
|
@@ -4547,7 +4547,8 @@ def parseImpl(self, instring, loc, doActions=True):
|
||
|
try:
|
||
|
return self.expr._parse(instring, loc, doActions, callPreParse=False)
|
||
|
except ParseBaseException as pbe:
|
||
|
- pbe.msg = self.errmsg
|
||
|
+ if not isinstance(self, Forward) or self.customName is not None:
|
||
|
+ pbe.msg = self.errmsg
|
||
|
raise
|
||
|
else:
|
||
|
raise ParseException(instring, loc, "No expression defined", self)
|