Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't fail in embedded Interpreter (closes #87)

  • Loading branch information...
commit c542f9b1d05c7d7f20e4904eca470b48e41e7b77 1 parent c205ddf
@anandology anandology authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 web/wsgi.py
View
8 web/wsgi.py
@@ -54,11 +54,15 @@ def runwsgi(func):
return httpserver.runsimple(func, validip(listget(sys.argv, 1, '')))
def _is_dev_mode():
+ # Some embedded python interpreters won't have sys.arv
+ # For details, see https://github.com/webpy/webpy/issues/87
+ argv = getattr(sys, "argv", [])
+
# quick hack to check if the program is running in dev mode.
if os.environ.has_key('SERVER_SOFTWARE') \
or os.environ.has_key('PHP_FCGI_CHILDREN') \
- or 'fcgi' in sys.argv or 'fastcgi' in sys.argv \
- or 'mod_wsgi' in sys.argv:
+ or 'fcgi' in argv or 'fastcgi' in argv \
+ or 'mod_wsgi' in argv:
return False
return True
Please sign in to comment.
Something went wrong with that request. Please try again.