Skip to content

Commit

Permalink
dev-ada/langkit: fix deprecated collections.Sequence
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/873787

Signed-off-by: Alfredo Tupone <[email protected]>
  • Loading branch information
atupone committed Oct 2, 2022
1 parent 32a73f9 commit 81a8882
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions dev-ada/langkit/files/langkit-22.0.0-abc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From cdc5768fb8db416e4eede97639f381a537ae9336 Mon Sep 17 00:00:00 2001
From: Charles Pigott <[email protected]>
Date: Wed, 10 Nov 2021 20:42:12 +0000
Subject: [PATCH] Use collections.abc.Sequence as the alias is set to be
removed

Alias has been in place since Py 3.3, and minimum (test) version is 3.7.
---
langkit/templates/python_api/module_py.mako | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/langkit/templates/python_api/module_py.mako b/langkit/templates/python_api/module_py.mako
index 831fb6044..65373fdbc 100644
--- a/langkit/templates/python_api/module_py.mako
+++ b/langkit/templates/python_api/module_py.mako
@@ -1503,7 +1503,7 @@ class ${root_astnode_name}:
if isinstance(ast_type_or_pred, type):
sought_type = ast_type_or_pred
pred = lambda node: isinstance(node, sought_type)
- elif isinstance(ast_type_or_pred, collections.Sequence):
+ elif isinstance(ast_type_or_pred, collections.abc.Sequence):
sought_types = ast_type_or_pred
pred = lambda node: isinstance(node, tuple(sought_types))
else:
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ RDEPEND="${PYTHON_DEPS}
dev-ada/e3-core[${PYTHON_USEDEP}]"
BDEPEND="${RDEPEND}"

PATCHES=( "${FILESDIR}"/${P}-abc.patch )

python_prepare_all() {
distutils-r1_python_prepare_all
cd testsuite/tests
Expand Down

0 comments on commit 81a8882

Please sign in to comment.