vlachoudis / bCNC

GRBL CNC command sender, autoleveler and g-code editor
GNU General Public License v2.0
1.54k stars 528 forks source link

Import ABC from collections.abc for Python 3.10 compatibility. #1673

Closed tirkarthi closed 2 years ago

tirkarthi commented 2 years ago

Fixes https://github.com/vlachoudis/bCNC/issues/1663

GitHubCaps commented 2 years ago

Good work, but should be placed in place of collections (with standard imports, not below the locals), just my 2 cents,

Just took a look at numpy-stl and it was already updated, so we should fetch it first, in case there are also other fixes. theirs:

try:  # pragma: no cover
    from collections import abc
except ImportError:  # pragma: no cover
    import collections as abc

class BaseMesh(logger.Logged, abc.Mapping):

theirs also fixes 3.11 in main.py

        args.name,
        getattr(args.outfile, 'name', None),
        getattr(args.infile, 'name', None),
       # 'numpy-stl-%06d' % random.randint(0, 1e6),
        'numpy-stl-%06d' % random.randint(0, 1_000_000),
    ]

    for name in names:  # pragma: no branch

so, we should update our lib/stl instead of simple issuing your proposed patch.

Harvie commented 2 years ago

Thanks for the fix and the review...