Author: russellm
Date: 2008-07-11 10:08:09 -0500 (Fri, 11 Jul 2008)
New Revision: 7891

Modified:
   django/trunk/django/core/management/commands/syncdb.py
Log:
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.

Modified: django/trunk/django/core/management/commands/syncdb.py
===================================================================
--- django/trunk/django/core/management/commands/syncdb.py      2008-07-11 
14:29:47 UTC (rev 7890)
+++ django/trunk/django/core/management/commands/syncdb.py      2008-07-11 
15:08:09 UTC (rev 7891)
@@ -41,10 +41,11 @@
                 # 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()


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to