Skip to content

Not compatible with Python 10 #17

@CyberShadow

Description

@CyberShadow
Traceback (most recent call last):
  File "/tmp/nix-build-python3.10-girc.drv-0/source/nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "setup.py", line 7, in <module>
    import girc
  File "/tmp/nix-build-python3.10-girc.drv-0/source/girc/__init__.py", line 32, in <module>
    from .client import ServerConnection
  File "/tmp/nix-build-python3.10-girc.drv-0/source/girc/client.py", line 12, in <module>
    from .capabilities import Capabilities
  File "/tmp/nix-build-python3.10-girc.drv-0/source/girc/capabilities.py", line 4, in <module>
    from .utils import CaseInsensitiveDict, CaseInsensitiveList
  File "/tmp/nix-build-python3.10-girc.drv-0/source/girc/utils.py", line 98, in <module>
    class CaseInsensitiveList(collections.MutableSequence):
AttributeError: module 'collections' has no attribute 'MutableSequence'

I think this should fix it:

diff --git a/girc/imapping.py b/girc/imapping.py
index 067fb3f..16b5bbc 100644
--- a/girc/imapping.py
+++ b/girc/imapping.py
@@ -64,7 +64,7 @@ class IMap:
             return value.translate(self._lower_trans)
 
 
-class IDict(collections.MutableMapping, IMap):
+class IDict(collections.abc.MutableMapping, IMap):
     """Case-insensitive IRC dict, based on IRC casemapping standards."""
 
     def __init__(self, data={}, *args, **kwargs):
@@ -107,7 +107,7 @@ class IDict(collections.MutableMapping, IMap):
         return new_dict
 
 
-class IList(collections.MutableSequence, IMap):
+class IList(collections.abc.MutableSequence, IMap):
     """Case-insensitive IRC list, based on IRC casemapping standards."""
 
     def __init__(self, data=[], *args):
diff --git a/girc/utils.py b/girc/utils.py
index ae4be62..8b4a66a 100644
--- a/girc/utils.py
+++ b/girc/utils.py
@@ -95,7 +95,7 @@ class NickMask:
 
 
 # just a custom casefolding list, designed for things like lists of keys
-class CaseInsensitiveList(collections.MutableSequence):
+class CaseInsensitiveList(collections.abc.MutableSequence):
 
     @staticmethod
     def _check_value(value):
@@ -163,11 +163,11 @@ class CaseInsensitiveList(collections.MutableSequence):
 #   limitations under the License.
 
 
-class CaseInsensitiveDict(collections.MutableMapping):
+class CaseInsensitiveDict(collections.abc.MutableMapping):
     """
     A case-insensitive ``dict``-like object.
     Implements all methods and operations of
-    ``collections.MutableMapping`` as well as dict's ``copy``. Also
+    ``collections.abc.MutableMapping`` as well as dict's ``copy``. Also
     provides ``lower_items``.
     All keys are expected to be strings. The structure remembers the
     case of the last key to be set, and ``iter(instance)``,
@@ -218,7 +218,7 @@ class CaseInsensitiveDict(collections.MutableMapping):
         )
 
     def __eq__(self, other):
-        if isinstance(other, collections.Mapping):
+        if isinstance(other, collections.abc.Mapping):
             other = CaseInsensitiveDict(other)
         else:
             return NotImplemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions