Ticket #16397: 16397.diff
File 16397.diff, 1.7 KB (added by , 13 years ago) |
---|
-
django/core/management/base.py
199 199 stderr. 200 200 201 201 """ 202 show_traceback = options.get('traceback', False) 203 202 204 # Switch to English, because django-admin.py creates database content 203 205 # like permissions, and those shouldn't contain any translations. 204 206 # But only do this if we can assume we have a working settings file, … … 210 212 except ImportError, e: 211 213 # If settings should be available, but aren't, 212 214 # raise the error and quit. 213 sys.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e))) 215 if show_traceback: 216 import traceback 217 traceback.print_exc() 218 else: 219 sys.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e))) 214 220 sys.exit(1) 215 221 try: 216 222 self.stdout = options.get('stdout', sys.stdout) … … 230 236 if self.output_transaction: 231 237 self.stdout.write('\n' + self.style.SQL_KEYWORD("COMMIT;") + '\n') 232 238 except CommandError, e: 233 self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e))) 239 if show_traceback: 240 import traceback 241 traceback.print_exc() 242 else: 243 self.stderr.write(smart_str(self.style.ERROR('Error: %s\n' % e))) 234 244 sys.exit(1) 235 245 236 246 def validate(self, app=None, display_num_errors=False):