diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2008-06-16 04:00:08 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2008-06-16 04:00:08 +0000 |
| commit | ee882b6abd83089f24f7329b97f5c551b6a2f2cb (patch) | |
| tree | 5f592c537cfd08856c6e532b73e01341e809cfed | |
| parent | a0a06d1a89465e7800686eec905e4c6f16911684 (diff) | |
Fixed #6497 -- Improved fixture error reporting by displaying the entire 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
| -rw-r--r-- | django/core/management/commands/loaddata.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py index 193bb26ccf..688cd58e2c 100644 --- a/django/core/management/commands/loaddata.py +++ b/django/core/management/commands/loaddata.py @@ -111,7 +111,10 @@ class Command(BaseCommand): 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 @@ class Command(BaseCommand): 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: |
