summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-10-04 17:55:34 +0100
committerSam James <sam@gentoo.org>2022-10-04 17:56:00 +0100
commita2e4008d4da759f5eeb2e1ff217cb4ed4148cde6 (patch)
treec219e18d0739531c715eb5ab5e2128a2b54eebe5 /dev-python
parentsys-kernel/gentoo-sources: add back 5.19.11 (diff)
downloadgentoo-a2e4008d4da759f5eeb2e1ff217cb4ed4148cde6.tar.gz
gentoo-a2e4008d4da759f5eeb2e1ff217cb4ed4148cde6.tar.bz2
gentoo-a2e4008d4da759f5eeb2e1ff217cb4ed4148cde6.zip
dev-python/typed-ast: fix Python 3.10 compat for 1.4.3
I'm absolutely convinced I committed this before like a year ago? Closes: https://bugs.gentoo.org/874900 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/typed-ast/files/typed-ast-1.4.3-python310.patch30
-rw-r--r--dev-python/typed-ast/typed-ast-1.4.3-r1.ebuild (renamed from dev-python/typed-ast/typed-ast-1.4.3.ebuild)6
2 files changed, 35 insertions, 1 deletions
diff --git a/dev-python/typed-ast/files/typed-ast-1.4.3-python310.patch b/dev-python/typed-ast/files/typed-ast-1.4.3-python310.patch
new file mode 100644
index 000000000000..7c95f2465f0d
--- /dev/null
+++ b/dev-python/typed-ast/files/typed-ast-1.4.3-python310.patch
@@ -0,0 +1,30 @@
+https://github.com/python/typed_ast/commit/123286721923ae8f3885dbfbad94d6ca940d5c96
+https://bugs.gentoo.org/874900
+
+From 123286721923ae8f3885dbfbad94d6ca940d5c96 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Wed, 10 Nov 2021 19:15:50 +0100
+Subject: [PATCH] Define _PyUnicode_DecodeUnicodeEscape even on Python 3.6+
+ (#171)
+
+--- a/ast3/Python/ast.c
++++ b/ast3/Python/ast.c
+@@ -56,6 +56,8 @@ _PyBytes_DecodeEscape(const char *s,
+ return PyBytes_DecodeEscape(s, len, errors, unicode, recode_encoding);
+ }
+
++#endif
++
+ PyObject *
+ _PyUnicode_DecodeUnicodeEscape(const char *s,
+ Py_ssize_t size,
+@@ -66,8 +68,6 @@ _PyUnicode_DecodeUnicodeEscape(const char *s,
+ return PyUnicode_DecodeUnicodeEscape(s, size, errors);
+ }
+
+-#endif
+-
+ static int validate_stmts(asdl_seq *);
+ static int validate_exprs(asdl_seq *, expr_context_ty, int);
+ static int validate_nonempty_seq(asdl_seq *, const char *, const char *);
+
diff --git a/dev-python/typed-ast/typed-ast-1.4.3.ebuild b/dev-python/typed-ast/typed-ast-1.4.3-r1.ebuild
index a1ffc97a501f..5b655ff3906b 100644
--- a/dev-python/typed-ast/typed-ast-1.4.3.ebuild
+++ b/dev-python/typed-ast/typed-ast-1.4.3-r1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..10} )
+PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
DESCRIPTION="Python typed-ast backported"
@@ -15,6 +15,10 @@ LICENSE="Apache-2.0 MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
+PATCHES=(
+ "${FILESDIR}"/${P}-python310.patch
+)
+
distutils_enable_tests pytest
python_test() {