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

Not compatible with Python 10 #17

Open
CyberShadow opened this issue Sep 18, 2023 · 0 comments
Open

Not compatible with Python 10 #17

CyberShadow opened this issue Sep 18, 2023 · 0 comments

Comments

@CyberShadow
Copy link

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
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

1 participant