Commits

Matt McClure  committed ec097d5

Silently ignore an exception if there are no dbs

The exception case happens when Django settings omit a database, for
example, in a pure unit test context.

  • Participants
  • Parent commits 3f6f206

Comments (0)

Files changed (1)

File south/db/__init__.py

     sys.exit(1)
     
 # Finally, to make old migrations work, keep 'db' around as the default database
-db = dbs[DEFAULT_DB_ALIAS]
+try:
+    db = dbs[DEFAULT_DB_ALIAS]
+except KeyError:
+    # Silently ignore the exception if there are no dbs. Should this
+    # create a dummy 'db' using, e.g., using south.db.generic? Would it
+    # be better to set 'db = None'?
+    pass