From 3d1ada6a3379e48f8da34971da8be22be39324e5 Mon Sep 17 00:00:00 2001 From: Paul McGuire Date: Sun, 30 Dec 2018 09:32:30 -0600 Subject: Update Travis-CI scripts to include examples; fix bug in runTests if postParse function returns None (or any non-str value) --- pyparsing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pyparsing.py') 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: -- cgit v1.2.1