[py3] Stopped iterating on exceptions. Refs #20025.
This commit is contained in:
parent
e81e319f15
commit
86b4ac665a
|
@ -125,7 +125,7 @@ class CursorWrapper(object):
|
||||||
except Database.OperationalError as e:
|
except Database.OperationalError as e:
|
||||||
# Map some error codes to IntegrityError, since they seem to be
|
# Map some error codes to IntegrityError, since they seem to be
|
||||||
# misclassified and Django would prefer the more logical place.
|
# 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])
|
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ class CursorWrapper(object):
|
||||||
except Database.OperationalError as e:
|
except Database.OperationalError as e:
|
||||||
# Map some error codes to IntegrityError, since they seem to be
|
# Map some error codes to IntegrityError, since they seem to be
|
||||||
# misclassified and Django would prefer the more logical place.
|
# 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])
|
six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue