Skip to content
This repository
Browse code

only call getopt when manage.py is run as a script (fix for zamboni.w…

…sgi)
  • Loading branch information...
commit e8e2c88279acee39e4e4cf1ff0a0d3bf53877333 1 parent db33ae3
Allen Short washort authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. +6 5 manage.py
11 manage.py
@@ -38,11 +38,12 @@
38 38 # Figuring out what settings file to use.
39 39 # 1. Look first for the command line setting.
40 40 setting = None
41   -found, rest = getopt.getopt(sys.argv[1:], 's:', 'settings=')
42   -try:
43   - setting = dict(found).values()[0]
44   -except IndexError:
45   - pass
  41 +if __name__ == '__main__':
  42 + found, rest = getopt.getopt(sys.argv[1:], 's:', 'settings=')
  43 + try:
  44 + setting = dict(found).values()[0]
  45 + except IndexError:
  46 + pass
46 47
47 48 # 2. If not, find the env variable.
48 49 if not setting:

0 comments on commit e8e2c88

Please sign in to comment.
Something went wrong with that request. Please try again.