Opened 2 years ago
Closed 2 years ago
#65990 closed defect (fixed)
Importing py310-oset generates "ImportError: cannot import name 'MutableSet' from 'collections'"
Reported by: | outis | Owned by: | jmroot (Joshua Root) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | py310-oset |
Description
When importing oset for Python 3.10, it generates the error:
ImportError: cannot import name 'MutableSet' from 'collections'
with the traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/oset/init.py", line 3, in <module>
from oset.pyoset import oset
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/oset/pyoset.py", line 16, in <module>
from collections import MutableSet
ImportError: cannot import name 'MutableSet' from 'collections' (/opt/local/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/init.py)
MutableSet
, along with other container classes, were moved from collections
to collections.abc
in Python 3.3, though aliases were maintained in later versions. Those aliases aren't present in Python 3.10, hence the error. The line should be updated to:
from collections.abc import MutableSet
Attachments (1)
Change History (3)
Changed 2 years ago by outis
Attachment: | py310-oset.patch added |
---|
comment:1 Changed 2 years ago by reneeotten (Renee Otten)
Priority: | High → Normal |
---|
the last update to that package was in 2012 - so I suspect you shouldn't expect a fix from upstream here... If you want to submit a PR with a patch for MacPorts that would probably be fine.
comment:2 Changed 2 years ago by jmroot (Joshua Root)
Owner: | set to jmroot |
---|---|
Resolution: | → fixed |
Status: | new → closed |
fix: updates module name