summaryrefslogtreecommitdiff
path: root/pyparsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyparsing.py')
-rw-r--r--pyparsing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pyparsing.py b/pyparsing.py
index b8609a9..a4a7546 100644
--- a/pyparsing.py
+++ b/pyparsing.py
@@ -1419,7 +1419,7 @@ class ParserElement(object):
exc.__cause__ = parse_action_exc
raise exc
- if tokens is not None:
+ if tokens is not None and tokens is not retTokens:
retTokens = ParseResults( tokens,
self.resultsName,
asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),
@@ -1438,7 +1438,7 @@ class ParserElement(object):
exc.__cause__ = parse_action_exc
raise exc
- if tokens is not None:
+ if tokens is not None and tokens is not retTokens:
retTokens = ParseResults( tokens,
self.resultsName,
asList=self.saveAsList and isinstance(tokens,(ParseResults,list)),