From: Matthijs Kooijman Date: Mon, 25 Oct 2010 09:17:04 +0000 (+0200) Subject: southsettings: Add argv length check. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fdorestad-bookings.git;a=commitdiff_plain;h=10e4ece01b035002cdf67efc917ed083c33a24e4 southsettings: Add argv length check. Without this check, manage.py would throw an exception when called without arguments. --- diff --git a/southsettings.py b/southsettings.py index 63ff314..338c62e 100644 --- a/southsettings.py +++ b/southsettings.py @@ -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: