Fixed #7421 -- Corrected the condition used during syncdb to establish that a management module is or isn't available. This is to satisfy non-CPython implementations which can use different error messages. Thanks to Maciej Fijalkowski (fijal) for his help confirming the problem.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7891 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2008-07-11 15:08:09 +00:00
parent e31945a2ad
commit b038abe1fe
1 changed files with 4 additions and 3 deletions

View File

@ -41,10 +41,11 @@ class Command(NoArgsCommand):
# but raises an ImportError for some reason. The only way we # but raises an ImportError for some reason. The only way we
# can do this is to check the text of the exception. Note that # can do this is to check the text of the exception. Note that
# we're a bit broad in how we check the text, because different # we're a bit broad in how we check the text, because different
# Python implementations may not use the same text. CPython # Python implementations may not use the same text.
# uses the text "No module named management". # CPython uses the text "No module named management"
# PyPy uses "No module named myproject.myapp.management"
msg = exc.args[0] msg = exc.args[0]
if not msg.startswith('No module named management') or 'management' not in msg: if not msg.startswith('No module named') or 'management' not in msg:
raise raise
cursor = connection.cursor() cursor = connection.cursor()