summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2024-11-17 16:07:23 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2024-11-18 16:05:37 +0100
commit8d7b1423f89bcc3df57333fc79fa5aead17b0cbc (patch)
tree17d8d8ed5b39749c70175358bb61806c926dda55 /django/template
parente035db1bc3bbeb4282a177ad106add3b07d97b09 (diff)
Refs #35844 -- Fixed copying BaseContext and its subclasses on Python 3.14+.
super objects are copyable on Python 3.14+: https://github.com/python/cpython/commit/5ca4e34bc1aab8321911aac6d5b2b9e75ff764d8 and can no longer be used in BaseContext.__copy__().
Diffstat (limited to 'django/template')
-rw-r--r--django/template/context.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/django/template/context.py b/django/template/context.py
index 0c28b479cd..90825fcdb5 100644
--- a/django/template/context.py
+++ b/django/template/context.py
@@ -37,7 +37,9 @@ class BaseContext:
self.dicts.append(value)
def __copy__(self):
- duplicate = copy(super())
+ duplicate = BaseContext()
+ duplicate.__class__ = self.__class__
+ duplicate.__dict__ = copy(self.__dict__)
duplicate.dicts = self.dicts[:]
return duplicate