summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/forms/widgets.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py
index 6b1be37ec2..3c4da2444d 100644
--- a/django/forms/widgets.py
+++ b/django/forms/widgets.py
@@ -110,9 +110,10 @@ class Media(StrAndUnicode):
def media_property(cls):
def _media(self):
# Get the media property of the superclass, if it exists
- if hasattr(super(cls, self), 'media'):
- base = super(cls, self).media
- else:
+ sup_cls = super(cls, self)
+ try:
+ base = sup_cls.media
+ except AttributeError:
base = Media()
# Get the media definition for this class