Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct use of collections breaks with Python3.10 #580

Closed
LordAro opened this issue Nov 10, 2021 · 0 comments · Fixed by #581
Closed

Direct use of collections breaks with Python3.10 #580

LordAro opened this issue Nov 10, 2021 · 0 comments · Fixed by #581

Comments

@LordAro
Copy link
Contributor

LordAro commented Nov 10, 2021

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant