summaryrefslogtreecommitdiff
path: root/pyparsing.py
diff options
context:
space:
mode:
authorEric Wald <gitter@brainshell.org>2019-03-10 14:38:43 -0600
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-03-10 15:38:43 -0500
commitf80565a285c1cc321344d3da8280c09560091491 (patch)
tree03fc9435af1e89237ca20aa47d85ec9e4c5d016f /pyparsing.py
parentae5adb02bf7e991111c05e71f9fb29c63b8cb11d (diff)
downloadpyparsing-git-f80565a285c1cc321344d3da8280c09560091491.tar.gz
Support for simple_unit_tests under Python 2 (#72)
Diffstat (limited to 'pyparsing.py')
-rw-r--r--pyparsing.py6
1 files changed, 5 insertions, 1 deletions
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):