_trim_arity can swallow genuine TypeErrors
Brought to you by:
ptmcg
If the function wrapped by _trim_arity raises a TypeError, _trim_arity assumes that it was to do with the function invocation and not anything internal to the invocation.
If the exception handler is changed to look more like this:
except TypeError, exc:
if not exc.message.startswith(func.__name__):
raise
if limit[0] <= maxargs:
limit[0] += 1
continue
raise
then the exceptions that are unrelated to the function are more likely to get through.
Benno -
I have taken several passes at this problem, but I think my latest efforts will be successful. I have checked into SVN an updated pyparsing.py that fixes this problem, and it will be included in the next full pyparsing release. Feel free to pull this version from SVN and give it a try.
Thanks,
-- Paul
Latest releases of pyparsing address this issue, thanks for raising it!