diff options
| author | Matthias Kestenholz <mk@feinheit.ch> | 2022-02-17 09:45:34 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-17 14:52:17 +0100 |
| commit | b2ed0d78f2dff9986ef15b9098c1b6d9ce720a99 (patch) | |
| tree | aa2afcb3c59b19d538ca6c281c83e6aeacf48f43 /django/utils/functional.py | |
| parent | a94ae4cb11b2b6a6fffb26f5a2dfd0c665e2070d (diff) | |
Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().
Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
Diffstat (limited to 'django/utils/functional.py')
| -rw-r--r-- | django/utils/functional.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py index 8dd8a8e006..5827389231 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -288,6 +288,9 @@ class LazyObject: self._wrapped = empty def __getattribute__(self, name): + if name == "_wrapped": + # Avoid recursion when getting wrapped object. + return super().__getattribute__(name) value = super().__getattribute__(name) # If attribute is a proxy method, raise an AttributeError to call # __getattr__() and use the wrapped object method. |
