File python-django-waliki-python3.10.patch of Package python-django-waliki
From e25b8788826471fb720a948eef5a2ca112250596 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Sat, 20 Nov 2021 23:37:01 +0000
Subject: [PATCH] Fix compatibility with Python 3.10.
* Import Iterable from collections.abc instead of collections.
* Import Mapping from collections.abc instead of collections.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
waliki/acl.py | 5 ++++-
waliki/settings.py | 7 +++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/waliki/acl.py b/waliki/acl.py
index 716568a..28151f6 100644
--- a/waliki/acl.py
+++ b/waliki/acl.py
@@ -1,5 +1,8 @@
from functools import wraps
-from collections import Iterable
+try:
+ from collections.abc import Iterable
+except ImportError:
+ from collections import Iterable
from django import VERSION
from django.conf import settings
from django.shortcuts import render
diff --git a/waliki/settings.py b/waliki/settings.py
index ae2dd70..4eaac27 100644
--- a/waliki/settings.py
+++ b/waliki/settings.py
@@ -1,6 +1,9 @@
import os.path
from importlib import import_module
-import collections
+try:
+ from collections.abc import Mapping
+except ImportError:
+ from collections import Mapping
from django.conf import settings
from .utils import get_url
from .directives.writer import WalikiHTML5Writer
@@ -25,7 +28,7 @@ def deep_update(d, u):
inspired in Alex Martelli's
http://stackoverflow.com/a/3233356"""
for k, v in u.items():
- if isinstance(v, collections.Mapping):
+ if isinstance(v, Mapping):
r = deep_update(d.get(k, {}), v)
d[k] = r
else:
--
2.33.1