Django

Code

Changeset 7653

Show
Ignore:
Timestamp:
06/15/08 23:00:08 (1 year ago)
Author:
adrian
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/commands/loaddata.py

    r7595 r7653  
    112112                                    obj.save() 
    113113                                label_found = True 
    114                             except Exception, e: 
     114                            except (SystemExit, KeyboardInterrupt): 
     115                                raise 
     116                            except Exception: 
     117                                import traceback 
    115118                                fixture.close() 
    116119                                transaction.rollback() 
     
    122125                                    sys.stderr.write( 
    123126                                        self.style.ERROR("Problem installing fixture '%s': %s\n" % 
    124                                              (full_path, str(e)))) 
     127                                             (full_path, traceback.format_exc()))) 
    125128                                return 
    126129                            fixture.close()