mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
This commit is contained in:
@@ -45,7 +45,7 @@ class URLValidator(RegexValidator):
|
||||
def __call__(self, value):
|
||||
try:
|
||||
super(URLValidator, self).__call__(value)
|
||||
except ValidationError, e:
|
||||
except ValidationError as e:
|
||||
# Trivial case failed. Try for possible IDN domain
|
||||
if value:
|
||||
value = smart_unicode(value)
|
||||
@@ -73,7 +73,7 @@ class EmailValidator(RegexValidator):
|
||||
def __call__(self, value):
|
||||
try:
|
||||
super(EmailValidator, self).__call__(value)
|
||||
except ValidationError, e:
|
||||
except ValidationError as e:
|
||||
# Trivial case failed. Try for possible IDN domain-part
|
||||
if value and u'@' in value:
|
||||
parts = value.split(u'@')
|
||||
|
||||
Reference in New Issue
Block a user