mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +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:
@@ -99,6 +99,6 @@ try:
|
||||
class MultipleAutoFields(models.Model):
|
||||
auto1 = models.AutoField(primary_key=True)
|
||||
auto2 = models.AutoField(primary_key=True)
|
||||
except AssertionError, assertion_error:
|
||||
except AssertionError as assertion_error:
|
||||
pass # Fail silently
|
||||
assert str(assertion_error) == u"A model can't have more than one AutoField."
|
||||
|
||||
Reference in New Issue
Block a user