From 1e2852a15dd120ff542a4805d8dceed82fb56ba7 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 7 Mar 2008 13:53:49 +0000 Subject: [PATCH] Fixed #6420 -- Corrected the handling of the --traceback option in loaddata. Thanks, Grzegorz Lukasik . git-svn-id: http://code.djangoproject.com/svn/django/trunk@7199 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/management/commands/loaddata.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index dde9e6eb80..d06b131d6f 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -108,10 +108,12 @@ class Command(BaseCommand): transaction.rollback() transaction.leave_transaction_management() if show_traceback: - raise - sys.stderr.write( - self.style.ERROR("Problem installing fixture '%s': %s\n" % - (full_path, str(e)))) + import traceback + traceback.print_exc() + else: + sys.stderr.write( + self.style.ERROR("Problem installing fixture '%s': %s\n" % + (full_path, str(e)))) return fixture.close() except: