summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-05-08 12:56:50 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-05-08 13:05:23 +0200
commit86b4ac665afe793a457ae84dfa1dfbbbb7e3c2bf (patch)
treed84175142baaa3d9ac27ce7331b4a8ecb18b93da /django
parente81e319f15f448d550d7e30b204d9490a9999b99 (diff)
[py3] Stopped iterating on exceptions. Refs #20025.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/mysql/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index 945d737354..dbddad7312 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -125,7 +125,7 @@ class CursorWrapper(object):
except Database.OperationalError as e:
# Map some error codes to IntegrityError, since they seem to be
# misclassified and Django would prefer the more logical place.
- if e[0] in self.codes_for_integrityerror:
+ if e.args[0] in self.codes_for_integrityerror:
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
raise
@@ -135,7 +135,7 @@ class CursorWrapper(object):
except Database.OperationalError as e:
# Map some error codes to IntegrityError, since they seem to be
# misclassified and Django would prefer the more logical place.
- if e[0] in self.codes_for_integrityerror:
+ if e.args[0] in self.codes_for_integrityerror:
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
raise