Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #6497 -- Improved fixture error reporting by displaying the ent…

…ire traceback. Also, SystemExit and KeyboardInterrupt now exit the script properly. Thanks for the patch, Bastian Kleineidam

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ee882b6abd83089f24f7329b97f5c551b6a2f2cb 1 parent a0a06d1
Adrian Holovaty adrianholovaty authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 django/core/management/commands/loaddata.py
7 django/core/management/commands/loaddata.py
View
@@ -111,7 +111,10 @@ def handle(self, *fixture_labels, **options):
models.add(obj.object.__class__)
obj.save()
label_found = True
- except Exception, e:
+ except (SystemExit, KeyboardInterrupt):
+ raise
+ except Exception:
+ import traceback
fixture.close()
transaction.rollback()
transaction.leave_transaction_management()
@@ -121,7 +124,7 @@ def handle(self, *fixture_labels, **options):
else:
sys.stderr.write(
self.style.ERROR("Problem installing fixture '%s': %s\n" %
- (full_path, str(e))))
+ (full_path, traceback.format_exc())))
return
fixture.close()
except:
Please sign in to comment.
Something went wrong with that request. Please try again.