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

python 3.10 support #118

Open
brainfo opened this issue Nov 11, 2022 · 1 comment
Open

python 3.10 support #118

brainfo opened this issue Nov 11, 2022 · 1 comment

Comments

@brainfo
Copy link

brainfo commented Nov 11, 2022

since collections in py 3.10 put MutableSet, MutableMapping, etc. in collections.abc
insert these lines

import sys 
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
    from collections.abc import MutableSet
    collections.MutableSet = collections.abc.MutableSet
else: 
    from collections import MutableSet

from https://stackoverflow.com/questions/74006130/attributeerror-module-collections-has-no-attribute-mutableset in interveltree.py would get over this version problem.

@Jeremiah-England
Copy link

@brainfo, I think you are using intervaltree 2.x. Since intervaltree 3.0.0 (released in 2018) the MutableSet has been imported like this:

https://github.com/chaimleib/intervaltree/blob/328d6db96596a0b7180dd3ad3fae4f6ff7301e01/intervaltree/intervaltree.py

try:
    from collections.abc import MutableSet  # Python 3?
except ImportError:
    from collections import MutableSet

We have been using intervaltree 3.1.0 on Python 3.10 and 3.11 and it has been working fine.

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

No branches or pull requests

2 participants