summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/boundfield.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/forms/boundfield.py b/django/forms/boundfield.py
index 7f40fbbbb4..8832169021 100644
--- a/django/forms/boundfield.py
+++ b/django/forms/boundfield.py
@@ -63,7 +63,10 @@ class BoundField:
# Prevent unnecessary reevaluation when accessing BoundField's attrs
# from templates.
if not isinstance(idx, (int, slice)):
- raise TypeError
+ raise TypeError(
+ 'BoundField indices must be integers or slices, not %s.'
+ % type(idx).__name__
+ )
return self.subwidgets[idx]
@property