commit:     a2e4008d4da759f5eeb2e1ff217cb4ed4148cde6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct  4 16:55:34 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct  4 16:56:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a2e4008d

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 <AT> gentoo.org>

 .../files/typed-ast-1.4.3-python310.patch          | 30 ++++++++++++++++++++++
 ...-ast-1.4.3.ebuild => typed-ast-1.4.3-r1.ebuild} |  6 ++++-
 2 files changed, 35 insertions(+), 1 deletion(-)

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?= <m...@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
similarity index 87%
rename from dev-python/typed-ast/typed-ast-1.4.3.ebuild
rename to 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() {

Reply via email to