Fixed #6420 -- Corrected the handling of the --traceback option in loaddata. Thanks, Grzegorz Lukasik <hauserx@gmail.com>.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7199 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2008-03-07 13:53:49 +00:00
parent 7092bcee6e
commit 1e2852a15d
1 changed files with 6 additions and 4 deletions

View File

@ -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: