From 73763332ada551d53320afedaa2665f397c3be5e Mon Sep 17 00:00:00 2001 From: Maryna Finko Date: Wed, 12 Apr 2023 14:57:11 +0200 Subject: [PATCH 1/2] Add support for Django 4.2 --- multiurl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/multiurl.py b/multiurl.py index 3acae95..8aeabf7 100644 --- a/multiurl.py +++ b/multiurl.py @@ -55,13 +55,16 @@ def resolve(self, path): class MultiResolverMatch(object): - def __init__(self, matches, exceptions, patterns_matched, path, route='', tried=None): + def __init__(self, matches, exceptions, patterns_matched, path, route='', tried=None, captured_kwargs={}, + extra_kwargs={}): self.matches = matches self.exceptions = exceptions self.patterns_matched = patterns_matched self.path = path self.route = route self.tried = tried + self.captured_kwargs = captured_kwargs + self.extra_kwargs = extra_kwargs # Attributes to emulate ResolverMatch self.kwargs = {} From 7c01ad4a44a3da12e8a6ea1f2567aa6f464e655c Mon Sep 17 00:00:00 2001 From: Maryna Finko Date: Thu, 13 Apr 2023 09:38:10 +0200 Subject: [PATCH 2/2] Update to default values to be immutable objects --- multiurl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multiurl.py b/multiurl.py index 8aeabf7..e2068ac 100644 --- a/multiurl.py +++ b/multiurl.py @@ -55,16 +55,16 @@ def resolve(self, path): class MultiResolverMatch(object): - def __init__(self, matches, exceptions, patterns_matched, path, route='', tried=None, captured_kwargs={}, - extra_kwargs={}): + def __init__(self, matches, exceptions, patterns_matched, path, route='', tried=None, captured_kwargs=None, + extra_kwargs=None): self.matches = matches self.exceptions = exceptions self.patterns_matched = patterns_matched self.path = path self.route = route self.tried = tried - self.captured_kwargs = captured_kwargs - self.extra_kwargs = extra_kwargs + self.captured_kwargs = captured_kwargs if captured_kwargs is not None else {} + self.extra_kwargs = extra_kwargs if extra_kwargs is not None else {} # Attributes to emulate ResolverMatch self.kwargs = {}