Fix some minor errors found during actual implementation of

example code.
This commit is contained in:
Phillip J. Eby 2004-09-16 01:56:44 +00:00
parent a214fcda03
commit b38414cc2a
1 changed files with 3 additions and 5 deletions

View File

@ -198,8 +198,7 @@ server.
def run_with_cgi(application):
environ = {}
environ.update(os.environ)
environ = dict(os.environ.items())
environ['wsgi.input'] = sys.stdin
environ['wsgi.errors'] = sys.stderr
environ['wsgi.version'] = (1,0)
@ -207,9 +206,6 @@ server.
environ['wsgi.multiprocess'] = True
environ['wsgi.last_call'] = True
# XXX really should set defaults for WSGI-required variables;
# see "environ Variables" section below
if environ.get('HTTPS','off') in ('on','1'):
environ['wsgi.url_scheme'] = 'https'
else:
@ -251,6 +247,8 @@ server.
try:
for data in result:
write(data)
if not headers_sent:
write('') # force headers to be sent
finally:
if hasattr(result,'close'):
result.close()