summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2016-05-13 08:52:57 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2016-05-13 08:52:57 +0000
commit0ffe4b6724d9aaacd764ea1e36e8b775d9ab3ee9 (patch)
treeff79b7749d1dc1f71fa6d2dd3713d9144225c3ad /src/pyparsing.py
parent27fa3814d29f19e3ad04aa07fc424ab8e79a4781 (diff)
downloadpyparsing-git-0ffe4b6724d9aaacd764ea1e36e8b775d9ab3ee9.tar.gz
Minor enhancement to traceParseAction decorator, to retain the parse action's name for the trace output
Some rework of unitTests.py, to simplify test suite building
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index 18f788a..3c0e13f 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -58,7 +58,7 @@ The pyparsing module handles some of the problems that are typically vexing when
"""
__version__ = "2.1.4"
-__versionTime__ = "12 May 2016 18:38 UTC"
+__versionTime__ = "13 May 2016 08:50 UTC"
__author__ = "Paul McGuire <ptmcg@users.sourceforge.net>"
import string
@@ -835,6 +835,16 @@ def _trim_arity(func, maxargs=2):
limit[0] += 1
continue
raise
+
+ # copy func name to wrapper for sensible debug output
+ func_name = "<parse action>"
+ try:
+ func_name = getattr(func, '__name__',
+ getattr(func, '__class__').__name__)
+ except Exception:
+ func_name = str(func)
+ wrapper.__name__ = func_name
+
return wrapper
class ParserElement(object):