summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-07-11 15:08:09 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-07-11 15:08:09 +0000
commitb038abe1fe0c5abc2f503eb8e464087349766c1c (patch)
treeeeb11a4d187be33f72d8bf85afe1eae6297a771f
parente31945a2ada75096883cea3f577dae509fd5c05d (diff)
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
-rw-r--r--django/core/management/commands/syncdb.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/django/core/management/commands/syncdb.py b/django/core/management/commands/syncdb.py
index 8e83ef61eb..3792a312d7 100644
--- a/django/core/management/commands/syncdb.py
+++ b/django/core/management/commands/syncdb.py
@@ -41,10 +41,11 @@ class Command(NoArgsCommand):
# but raises an ImportError for some reason. The only way we
# 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
- # Python implementations may not use the same text. CPython
- # uses the text "No module named management".
+ # Python implementations may not use the same text.
+ # CPython uses the text "No module named management"
+ # PyPy uses "No module named myproject.myapp.management"
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
cursor = connection.cursor()