From be53c454da4c176b9b6494271f1fdda02aeae8fc Mon Sep 17 00:00:00 2001 From: Edwin Eefting Date: Tue, 4 Apr 2023 16:27:18 +0200 Subject: [PATCH] workaround python 3.10 unittest2 problem --- tests/basetest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/basetest.py b/tests/basetest.py index 461c318..3994b81 100644 --- a/tests/basetest.py +++ b/tests/basetest.py @@ -2,6 +2,15 @@ # To run tests as non-root, use this hack: # chmod 4755 /usr/sbin/zpool /usr/sbin/zfs +import sys + +#dirty hack for this error: +#AttributeError: module 'collections' has no attribute 'MutableMapping' + +if sys.version_info.major == 3 and sys.version_info.minor >= 10: + import collections + setattr(collections, "MutableMapping", collections.abc.MutableMapping) + import subprocess import random