summaryrefslogtreecommitdiff
path: root/pyparsing.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyparsing.py')
-rw-r--r--pyparsing.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pyparsing.py b/pyparsing.py
index 975846c..89c48d9 100644
--- a/pyparsing.py
+++ b/pyparsing.py
@@ -2454,7 +2454,9 @@ class ParserElement(object):
success = success and not failureTests
if postParse is not None:
try:
- out.append(postParse(t, result))
+ pp_value = postParse(t, result)
+ if pp_value is not None:
+ out.append(str(pp_value))
except Exception as e:
out.append("{} failed: {}: {}".format(postParse.__name__, type(e).__name__, e))
except ParseBaseException as pe: