From f80565a285c1cc321344d3da8280c09560091491 Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Sun, 10 Mar 2019 14:38:43 -0600 Subject: Support for simple_unit_tests under Python 2 (#72) --- pyparsing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pyparsing.py') diff --git a/pyparsing.py b/pyparsing.py index 4ba5b11..3befc7c 100644 --- a/pyparsing.py +++ b/pyparsing.py @@ -350,7 +350,11 @@ class ParseException(ParseBaseException): callers = inspect.getinnerframes(exc.__traceback__, context=depth) seen = set() for i, ff in enumerate(callers[-depth:]): - frm = ff.frame + if isinstance(ff, tuple): + # Python 2 compatibility + frm = ff[0] + else: + frm = ff.frame f_self = frm.f_locals.get('self', None) if isinstance(f_self, ParserElement): -- cgit v1.2.1