summaryrefslogtreecommitdiff
path: root/src/pyparsing.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-05-11 15:15:17 +0000
committerptmcg <ptmcg@9bf210a0-9d2d-494c-87cf-cfb32e7dff7b>2016-05-11 15:15:17 +0000
commita1809e1bcce811c5c6ea4d3eac3b570ee97803cb (patch)
tree697d60c28c76535e820b24d33dbd74f2e455f60c /src/pyparsing.py
parentadb075a0b46886b69abb44c50b2f9090bed6c816 (diff)
downloadpyparsing-a1809e1bcce811c5c6ea4d3eac3b570ee97803cb.tar.gz
traceback module variations between Py3.5.0 and Py3.5.1
git-svn-id: svn://svn.code.sf.net/p/pyparsing/code/trunk@340 9bf210a0-9d2d-494c-87cf-cfb32e7dff7b
Diffstat (limited to 'src/pyparsing.py')
-rw-r--r--src/pyparsing.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pyparsing.py b/src/pyparsing.py
index 917be82..c75aff2 100644
--- a/src/pyparsing.py
+++ b/src/pyparsing.py
@@ -788,9 +788,12 @@ def _trim_arity(func, maxargs=2):
foundArity = [False]
# traceback return data structure changed in Py3.5 - normalize back to plain tuples
- if tuple(sys.version_info) >= (3,5):
+ ver = tuple(sys.version_info)[:3]
+ if ver[:2] >= (3,5):
def extract_stack():
- frame_summary = traceback.extract_stack()[-3]
+ # special handling for Python 3.5.0 - extra deep call stack by 1
+ offset = -3 if ver == (3,5,0) else -2
+ frame_summary = traceback.extract_stack()[offset]
return [(frame_summary.filename, frame_summary.lineno)]
def extract_tb(tb):
frames = traceback.extract_tb(tb)