diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-11-30 18:11:31 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-11-30 19:05:40 +0100 |
commit | 1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946 (patch) | |
tree | e4cd6ab0c2fd3e08005874d57a3db73d9db888f1 /dev-python/flask | |
parent | dev-python/requests: Enable pypy3 (diff) | |
download | gentoo-1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946.tar.gz gentoo-1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946.tar.bz2 gentoo-1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946.zip |
dev-python/flask: Backport PyPy3 fix, #601298
Diffstat (limited to 'dev-python/flask')
-rw-r--r-- | dev-python/flask/files/flask-0.11.1-pypy3.patch | 45 | ||||
-rw-r--r-- | dev-python/flask/flask-0.11.1-r1.ebuild (renamed from dev-python/flask/flask-0.11.1.ebuild) | 6 |
2 files changed, 50 insertions, 1 deletions
diff --git a/dev-python/flask/files/flask-0.11.1-pypy3.patch b/dev-python/flask/files/flask-0.11.1-pypy3.patch new file mode 100644 index 000000000000..8f27c344e204 --- /dev/null +++ b/dev-python/flask/files/flask-0.11.1-pypy3.patch @@ -0,0 +1,45 @@ +From 6e46d0cd3969f6c13ff61c95c81a975192232fed Mon Sep 17 00:00:00 2001 +From: Markus Unterwaditzer <markus@unterwaditzer.net> +Date: Mon, 13 Jun 2016 20:29:21 +0200 +Subject: [PATCH] Fix PyPy3 support and add bug references + +Fix #1841 +--- + flask/_compat.py | 18 +++++++++++++----- + 2 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/flask/_compat.py b/flask/_compat.py +index bfe607d..071628f 100644 +--- a/flask/_compat.py ++++ b/flask/_compat.py +@@ -65,17 +65,25 @@ def __new__(cls, name, this_bases, d): + + + # Certain versions of pypy have a bug where clearing the exception stack +-# breaks the __exit__ function in a very peculiar way. This is currently +-# true for pypy 2.2.1 for instance. The second level of exception blocks +-# is necessary because pypy seems to forget to check if an exception +-# happened until the next bytecode instruction? ++# breaks the __exit__ function in a very peculiar way. The second level of ++# exception blocks is necessary because pypy seems to forget to check if an ++# exception happened until the next bytecode instruction? ++# ++# Relevant PyPy bugfix commit: ++# https://bitbucket.org/pypy/pypy/commits/77ecf91c635a287e88e60d8ddb0f4e9df4003301 ++# According to ronan on #pypy IRC, it is released in PyPy2 2.3 and later ++# versions. ++# ++# Ubuntu 14.04 has PyPy 2.2.1, which does exhibit this bug. + BROKEN_PYPY_CTXMGR_EXIT = False + if hasattr(sys, 'pypy_version_info'): + class _Mgr(object): + def __enter__(self): + return self + def __exit__(self, *args): +- sys.exc_clear() ++ if hasattr(sys, 'exc_clear'): ++ # Python 3 (PyPy3) doesn't have exc_clear ++ sys.exc_clear() + try: + try: + with _Mgr(): diff --git a/dev-python/flask/flask-0.11.1.ebuild b/dev-python/flask/flask-0.11.1-r1.ebuild index b579284dbe99..dd9dff905cce 100644 --- a/dev-python/flask/flask-0.11.1.ebuild +++ b/dev-python/flask/flask-0.11.1-r1.ebuild @@ -33,9 +33,13 @@ DEPEND="${RDEPEND} S="${WORKDIR}/${MY_P}" python_prepare_all() { - # Prevent un-needed d'loading + # Prevent un-needed d'loading sed -e "s/ 'sphinx.ext.intersphinx',//" -i docs/conf.py || die + local PATCHES=( + "${FILESDIR}"/${P}-pypy3.patch + ) + distutils-r1_python_prepare_all } |