From cc9126ed2b215fe6c59ca9eb74e6e0a55b9fc76e Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 11 Oct 2015 22:45:07 -0600 Subject: Make sure we test on Python 3.5 --- .travis.yml | 34 ++++++++++++++++++++++------------ tox.ini | 3 ++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index ba077d342..79d9fa09d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,18 +2,28 @@ language: python sudo: false -env: - - TOXENV=py26 - - TOXENV=py27 - - TOXENV=py32 - - TOXENV=py33 - - TOXENV=py34 - - TOXENV=pypy - - TOXENV=pypy3 - - TOXENV=py2-docs - - TOXENV=py3-docs - - TOXENV=py2-cover,py3-cover,coverage - - TOXENV=pep8 +matrix: + include: + - python: 2.6 + env: TOXENV=py26 + - python: 2.7 + env: TOXENV=py27 + - python: 3.2 + env: TOXENV=py32 + - python: 3.3 + env: TOXENV=py33 + - python: 3.4 + env: TOXENV=py34 + - python: 3.5 + env: TOXENV=py35 + - python: pypy + env: TOXENV=pypy + - python: pypy3 + env: TOXENV=pypy3 + - python: 3.5 + env: TOXENV=py2-cover,py3-cover,coverage + - python: 3.5 + env: TOXENV=pep8 install: - travis_retry pip install tox diff --git a/tox.ini b/tox.ini index d3e494de9..ae93c3785 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py26,py27,py32,py33,py34,pypy,pypy3,pep8, + py26,py27,py32,py33,py34,py35,pypy,pypy3,pep8, {py2,py3}-docs, {py2,py3}-cover,coverage, @@ -13,6 +13,7 @@ basepython = py32: python3.2 py33: python3.3 py34: python3.4 + py35: python3.5 pypy: pypy pypy3: pypy3 py2: python2.7 -- cgit v1.2.3 From ce042deddabc824caefdcaaf97f3ab9654777a96 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 11 Oct 2015 22:45:26 -0600 Subject: Fix Python 3.5 support Python 3.5 inserts an extra stackframe when calling extract_traceback, this adds in a check to see if the last frame is this extra frame, and if so removes it. This doesn't affect any other version of Python. --- pyramid/util.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pyramid/util.py b/pyramid/util.py index 1ae7e6afc..12eae3626 100644 --- a/pyramid/util.py +++ b/pyramid/util.py @@ -554,7 +554,14 @@ def action_method(wrapped): info = ActionInfo(*info) if info is None: try: - f = traceback.extract_stack(limit=3) + f = traceback.extract_stack(limit=4) + + # Work around a Python 3.5 issue whereby it would insert an + # extra stack frame. This should no longer be necessary in + # Python 3.5.1 + last_frame = ActionInfo(*f[-1]) + if last_frame.function == 'extract_stack': + f.pop() info = ActionInfo(*f[-backframes]) except: # pragma: no cover info = ActionInfo(None, 0, '', '') -- cgit v1.2.3 From 6013930f5e119e3383588aeb2802811111caac40 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 11 Oct 2015 23:55:14 -0600 Subject: No cover a branch --- pyramid/util.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid/util.py b/pyramid/util.py index 12eae3626..5e43383b7 100644 --- a/pyramid/util.py +++ b/pyramid/util.py @@ -560,7 +560,7 @@ def action_method(wrapped): # extra stack frame. This should no longer be necessary in # Python 3.5.1 last_frame = ActionInfo(*f[-1]) - if last_frame.function == 'extract_stack': + if last_frame.function == 'extract_stack': # pragma: no cover f.pop() info = ActionInfo(*f[-backframes]) except: # pragma: no cover diff --git a/tox.ini b/tox.ini index ae93c3785..20a9ee5b1 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ basepython = pypy: pypy pypy3: pypy3 py2: python2.7 - py3: python3.4 + py3: python3.5 commands = pip install pyramid[testing] -- cgit v1.2.3