From 8d6fcfcd40d4130128e7ade1d3e43b0e63686045 Mon Sep 17 00:00:00 2001
From: Bastian Kleineidam <calvin@debian.org>
Date: Mon, 28 Jan 2008 08:40:59 +0100
Subject: Improved fixture error reporting
Print a complete traceback on fixture data error, and do not
hide SystemExit and KeyboardInterrupt errors.
Signed-off-by: Bastian Kleineidam <calvin@debian.org>
diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index d47e65f..74b27ab 100644
|
a
|
b
|
class Command(BaseCommand):
|
| 102 | 102 | models.add(obj.object.__class__) |
| 103 | 103 | obj.save() |
| 104 | 104 | label_found = True |
| 105 | | except Exception, e: |
| | 105 | except (SystemExit, KeyboardInterrupt): |
| | 106 | raise |
| | 107 | except Exception: |
| | 108 | import traceback |
| 106 | 109 | fixture.close() |
| 107 | 110 | transaction.rollback() |
| 108 | 111 | transaction.leave_transaction_management() |
| … |
… |
class Command(BaseCommand):
|
| 110 | 113 | raise |
| 111 | 114 | sys.stderr.write( |
| 112 | 115 | self.style.ERROR("Problem installing fixture '%s': %s\n" % |
| 113 | | (full_path, str(e)))) |
| | 116 | (full_path, traceback.format_exc()))) |
| 114 | 117 | return |
| 115 | 118 | fixture.close() |
| 116 | 119 | except: |