summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/newforms/forms.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index 503e17937a..29e387a51b 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -179,10 +179,7 @@ class BoundField(StrAndUnicode):
Returns an ErrorList for this field. Returns an empty ErrorList
if there are none.
"""
- try:
- return self.form.errors[self.name]
- except KeyError:
- return ErrorList()
+ return self.form.errors.get(self.name, ErrorList())
errors = property(_errors)
def as_widget(self, widget, attrs=None):