summaryrefslogtreecommitdiff
path: root/django/dispatch
diff options
context:
space:
mode:
authorMateo Radman <48420316+mateoradman@users.noreply.github.com>2021-06-20 20:16:33 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-06-25 06:55:47 +0200
commit8a7ac78b706797a03d26b88eddb9d1067ed35b66 (patch)
treedbba445b3fe90377ffae9e4c605beb0ecb3ae93a /django/dispatch
parent64839512a6ed04a29e49e246acf8337b1be2cb8e (diff)
Refs #32508 -- Raised ImproperlyConfigured/TypeError instead of using "assert" in various code.
Diffstat (limited to 'django/dispatch')
-rw-r--r--django/dispatch/dispatcher.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/dispatch/dispatcher.py b/django/dispatch/dispatcher.py
index c9d5788fa9..d3630ae784 100644
--- a/django/dispatch/dispatcher.py
+++ b/django/dispatch/dispatcher.py
@@ -80,8 +80,8 @@ class Signal:
# If DEBUG is on, check that we got a good receiver
if settings.configured and settings.DEBUG:
- assert callable(receiver), "Signal receivers must be callable."
-
+ if not callable(receiver):
+ raise TypeError('Signal receivers must be callable.')
# Check for **kwargs
if not func_accepts_kwargs(receiver):
raise ValueError("Signal receivers must accept keyword arguments (**kwargs).")