summaryrefslogtreecommitdiff
path: root/pyparsing/core.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2021-12-26 08:55:32 -0600
committerptmcg <ptmcg@austin.rr.com>2021-12-26 08:55:32 -0600
commit577145948bd6063f34a37933ca3a476b5f7ddc4b (patch)
treed4e690a0ce6ead011b7802f8f5c79b07e5683b2f /pyparsing/core.py
parent5e3e1bbfac8725db8b8c1aee60a098db00a4eeea (diff)
downloadpyparsing-git-577145948bd6063f34a37933ca3a476b5f7ddc4b.tar.gz
Fixed bug in ParserElement.run_tests where comments would be displayed using with_line_numbers, even if with_line_numbers was set to False.
Diffstat (limited to 'pyparsing/core.py')
-rw-r--r--pyparsing/core.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py
index 9571499..7751035 100644
--- a/pyparsing/core.py
+++ b/pyparsing/core.py
@@ -2067,7 +2067,7 @@ class ParserElement(ABC):
BOM = "\ufeff"
for t in tests:
if comment is not None and comment.matches(t, False) or comments and not t:
- comments.append(pyparsing_test.with_line_numbers(t))
+ comments.append(pyparsing_test.with_line_numbers(t) if with_line_numbers else t)
continue
if not t:
continue