1 |
commit: 1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 30 17:11:31 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 30 18:05:40 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1abbfd2c |
7 |
|
8 |
dev-python/flask: Backport PyPy3 fix, #601298 |
9 |
|
10 |
dev-python/flask/files/flask-0.11.1-pypy3.patch | 45 ++++++++++++++++++++++ |
11 |
...{flask-0.11.1.ebuild => flask-0.11.1-r1.ebuild} | 6 ++- |
12 |
2 files changed, 50 insertions(+), 1 deletion(-) |
13 |
|
14 |
diff --git a/dev-python/flask/files/flask-0.11.1-pypy3.patch b/dev-python/flask/files/flask-0.11.1-pypy3.patch |
15 |
new file mode 100644 |
16 |
index 00000000..8f27c34 |
17 |
--- /dev/null |
18 |
+++ b/dev-python/flask/files/flask-0.11.1-pypy3.patch |
19 |
@@ -0,0 +1,45 @@ |
20 |
+From 6e46d0cd3969f6c13ff61c95c81a975192232fed Mon Sep 17 00:00:00 2001 |
21 |
+From: Markus Unterwaditzer <markus@×××××××××××××.net> |
22 |
+Date: Mon, 13 Jun 2016 20:29:21 +0200 |
23 |
+Subject: [PATCH] Fix PyPy3 support and add bug references |
24 |
+ |
25 |
+Fix #1841 |
26 |
+--- |
27 |
+ flask/_compat.py | 18 +++++++++++++----- |
28 |
+ 2 files changed, 20 insertions(+), 5 deletions(-) |
29 |
+ |
30 |
+diff --git a/flask/_compat.py b/flask/_compat.py |
31 |
+index bfe607d..071628f 100644 |
32 |
+--- a/flask/_compat.py |
33 |
++++ b/flask/_compat.py |
34 |
+@@ -65,17 +65,25 @@ def __new__(cls, name, this_bases, d): |
35 |
+ |
36 |
+ |
37 |
+ # Certain versions of pypy have a bug where clearing the exception stack |
38 |
+-# breaks the __exit__ function in a very peculiar way. This is currently |
39 |
+-# true for pypy 2.2.1 for instance. The second level of exception blocks |
40 |
+-# is necessary because pypy seems to forget to check if an exception |
41 |
+-# happened until the next bytecode instruction? |
42 |
++# breaks the __exit__ function in a very peculiar way. The second level of |
43 |
++# exception blocks is necessary because pypy seems to forget to check if an |
44 |
++# exception happened until the next bytecode instruction? |
45 |
++# |
46 |
++# Relevant PyPy bugfix commit: |
47 |
++# https://bitbucket.org/pypy/pypy/commits/77ecf91c635a287e88e60d8ddb0f4e9df4003301 |
48 |
++# According to ronan on #pypy IRC, it is released in PyPy2 2.3 and later |
49 |
++# versions. |
50 |
++# |
51 |
++# Ubuntu 14.04 has PyPy 2.2.1, which does exhibit this bug. |
52 |
+ BROKEN_PYPY_CTXMGR_EXIT = False |
53 |
+ if hasattr(sys, 'pypy_version_info'): |
54 |
+ class _Mgr(object): |
55 |
+ def __enter__(self): |
56 |
+ return self |
57 |
+ def __exit__(self, *args): |
58 |
+- sys.exc_clear() |
59 |
++ if hasattr(sys, 'exc_clear'): |
60 |
++ # Python 3 (PyPy3) doesn't have exc_clear |
61 |
++ sys.exc_clear() |
62 |
+ try: |
63 |
+ try: |
64 |
+ with _Mgr(): |
65 |
|
66 |
diff --git a/dev-python/flask/flask-0.11.1.ebuild b/dev-python/flask/flask-0.11.1-r1.ebuild |
67 |
similarity index 93% |
68 |
rename from dev-python/flask/flask-0.11.1.ebuild |
69 |
rename to dev-python/flask/flask-0.11.1-r1.ebuild |
70 |
index b579284..dd9dff9 100644 |
71 |
--- a/dev-python/flask/flask-0.11.1.ebuild |
72 |
+++ b/dev-python/flask/flask-0.11.1-r1.ebuild |
73 |
@@ -33,9 +33,13 @@ DEPEND="${RDEPEND} |
74 |
S="${WORKDIR}/${MY_P}" |
75 |
|
76 |
python_prepare_all() { |
77 |
- # Prevent un-needed d'loading |
78 |
+ # Prevent un-needed d'loading |
79 |
sed -e "s/ 'sphinx.ext.intersphinx',//" -i docs/conf.py || die |
80 |
|
81 |
+ local PATCHES=( |
82 |
+ "${FILESDIR}"/${P}-pypy3.patch |
83 |
+ ) |
84 |
+ |
85 |
distutils-r1_python_prepare_all |
86 |
} |