This line https://github.com/FreeCAD/FreeCAD/blob ... io.py#L342
breaks the test when python 3.10 is used. See issue #4825 specifically this comment
According to this stackoverflow answer
collections.Iterable is deprecated in favor of collections.abc.Iterable
How do we add the logic to support either?
[Fixed]FEM test sifio.py breaks when compiled with python 3.10
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
[Fixed]FEM test sifio.py breaks when compiled with python 3.10
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: FEM test sifio.py breaks when compiled with python 3.10
Maybe something like this?Kunda1 wrote: ↑Sun Jan 23, 2022 7:41 pm This line https://github.com/FreeCAD/FreeCAD/blob ... io.py#L342
breaks the test when python 3.10 is used. ...
According to this stackoverflow answer
collections.Iterable is deprecated in favor of collections.abc.Iterable
How do we add the logic to support either?
Code: Select all
def _isCollection(self, data):
if sys.version_info.major == 3 and sys.version_info.minor > 10:
return (not isinstance(data, six.string_types)
and isinstance(data, collections.abc.Iterable)
else:
return (not isinstance(data, six.string_types)
and isinstance(data, collections.Iterable)
)
My latest (or last) project: B-spline Construction Project.
Re: FEM test sifio.py breaks when compiled with python 3.10
Wouldn't it be better to refactor whatever creates those iterables to always use the abc-version? It has been available in the new place since python 3.3 (10 years ago)
Re: FEM test sifio.py breaks when compiled with python 3.10
Oh in that case of course (and I see wmayer already made the change). I was going solely from the information I read in the forum and tracker
My latest (or last) project: B-spline Construction Project.