Skip to content
Snippets Groups Projects
Commit 038ac3fb authored by Martin Burchell's avatar Martin Burchell
Browse files

Python 3 re-raising of exceptions

parent a09a0d72
No related branches found
No related tags found
2 merge requests!166Staging,!157Django 2.2 and Python 3 upgrade
......@@ -108,7 +108,7 @@ class Importer(object):
objects.append(item)
except SheetImportException as e:
raise type(e), type(e)(str(e) + 'in row {0} '.format(i)), sys.exc_info()[2]
raise type(e)(str(e) + 'in row {0} '.format(i)) from e
return objects
......@@ -232,7 +232,7 @@ class CellConverter(object):
return converters[self.type](self.value)
except Exception as e:
message = _("{0}: Can not process value '{1}' of type '{2}' ").format(str(e), self.value, self.type)
raise SheetImportException(message), None, sys.exc_info()[2]
raise SheetImportException(message) from e
def convert_date(self):
if self.value is None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment