From 1a8ad8a5c6f3344959e81531177164d1c4c4e52a Mon Sep 17 00:00:00 2001 From: Nick Pope Date: Fri, 2 Oct 2020 12:21:15 +0100 Subject: [PATCH] Removed unused custom exception support for ImmutableList. If the warning provided was an instance of Exception, then it would be used as-is. In practice this is untested, unused and ImmutableList is an undocumented internal datastructure. --- django/utils/datastructures.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 083cf3cb8b..740ad5a86d 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -230,11 +230,8 @@ class ImmutableList(tuple): self.warning = warning return self - def complain(self, *wargs, **kwargs): - if isinstance(self.warning, Exception): - raise self.warning - else: - raise AttributeError(self.warning) + def complain(self, *args, **kwargs): + raise AttributeError(self.warning) # All list mutation functions complain. __delitem__ = complain