From d6d25ae2e07adfb363ed6f968eb800693cc6f1e6 Mon Sep 17 00:00:00 2001 From: Emanuel Medina Gomez <50502795+emedinag@users.noreply.github.com> Date: Wed, 13 Sep 2023 02:21:30 +0000 Subject: [PATCH] Fix python3 collections change, taken from https://stackoverflow.com/questions/70943244/attributeerror-module-collections-has-no-attribute-mutablemapping --- autoload/conque_gdb/conque_gdb.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/conque_gdb/conque_gdb.py b/autoload/conque_gdb/conque_gdb.py index c54e3c8..28b606b 100644 --- a/autoload/conque_gdb/conque_gdb.py +++ b/autoload/conque_gdb/conque_gdb.py @@ -1,4 +1,9 @@ import re, collections +if sys.version_info.major == 3 and sys.version_info.minor >= 10: + + from collections.abc import MutableMapping +else: + from collections import MutableMapping # Marks that a breakpoint has been hit GDB_BREAK_MARK = '\x1a\x1a' @@ -36,7 +41,7 @@ def __init__(self, fname, line, enable): def __str__(self): return self.filename + ':' + self.lineno + ',' + self.enabled -class RegisteredBpDict(collections.MutableMapping): +class RegisteredBpDict(MutableMapping): def __init__(self): self.r_breaks = dict() self.lookups = dict()