1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

new-admin: Changed django.core.management.init to sys.exit(1) instead of raise on error

git-svn-id: http://code.djangoproject.com/svn/django/branches/new-admin@1389 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2005-11-24 03:35:06 +00:00
parent 942d02a885
commit 7ee9f5c7c5

View File

@ -362,12 +362,12 @@ def init():
(db.db.quote_name(core.Site._meta.db_table), db.db.quote_name('domain'), (db.db.quote_name(core.Site._meta.db_table), db.db.quote_name('domain'),
db.db.quote_name('name'))) db.db.quote_name('name')))
except Exception, e: except Exception, e:
sys.stderr.write("Error: The database couldn't be initialized.\n%s\n" % e) sys.stderr.write("Error: The database couldn't be initialized.\n%s\n" % e)
try: try:
db.db.rollback() db.db.rollback()
except UnboundLocalError: except UnboundLocalError:
pass pass
raise sys.exit(1)
else: else:
db.db.commit() db.db.commit()
init.args = '' init.args = ''