southsettings: Add argv length check.
authorMatthijs Kooijman <matthijs@stdin.nl>
Mon, 25 Oct 2010 09:17:04 +0000 (11:17 +0200)
committerMatthijs Kooijman <matthijs@stdin.nl>
Mon, 25 Oct 2010 09:17:04 +0000 (11:17 +0200)
Without this check, manage.py would throw an exception when called
without arguments.

southsettings.py

index 63ff314cf6bb120314c2972f4e6a82c189b52569..338c62ea476d2f0089bf5d2851a3fb93949710c5 100644 (file)
@@ -2,7 +2,7 @@
 # which requires more privileges.
 
 import sys
-if 'manage.py' in sys.argv[0] and sys.argv[1] == 'migrate':
+if len(sys.argv) >= 2 and 'manage.py' in sys.argv[0] and sys.argv[1] == 'migrate':
     import south
 
     try: