Changed exception syntax to work with Python 2.5.

This commit is contained in:
Eevee 2009-07-28 08:25:11 -07:00
parent 7347da558a
commit d997e27112

View file

@ -104,7 +104,7 @@ def command_csvimport(engine_uri, directory='.'):
try: try:
session.add(row) session.add(row)
session.flush() session.flush()
except IntegrityError as e: except IntegrityError, e:
failed_rows.append(row) failed_rows.append(row)
# Loop over the failed rows and keep trying to insert them. If a loop # Loop over the failed rows and keep trying to insert them. If a loop
@ -121,7 +121,7 @@ def command_csvimport(engine_uri, directory='.'):
# Success! # Success!
del failed_rows[i] del failed_rows[i]
do_another_loop = True do_another_loop = True
except IntegrityError as e: except IntegrityError, e:
pass pass
if failed_rows: if failed_rows: