AdaCore / langkit

Language creation framework.

Home Page:https://www.adacore.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Direct use of collections breaks with Python3.10

LordAro opened this issue · comments

Various collections.* -> collections.abc.* aliases were removed in Python 3.10

This causes in libadalang tests like:

_Output:
_Traceback (most recent call last):
_  File "C:\libadalang\tmp\python__R918-040_rebindings\test.py", line 19, in <module>
_    ps = u.root.find(lambda n: n.text == 'Foo').parent
_  File "C:\libadalang\build\python\libadalang\__init__.py", line 2941, in find
_    return next(self.finditer(ast_type_or_pred, **kwargs))
_  File "C:\libadalang\build\python\libadalang\__init__.py", line 2972, in finditer
_    elif isinstance(ast_type_or_pred, collections.Sequence):
_AttributeError: module 'collections' has no attribute 'Sequence'

elif isinstance(ast_type_or_pred, collections.Sequence):

should be

        elif isinstance(ast_type_or_pred, collections.abc.Sequence):

(no change of import necessary, I believe)