Skip to content

Commit

Permalink
Python 3: no dict.has_key
Browse files Browse the repository at this point in the history
It's very hard to debug these because exceptions in the thread are
swallowed, not printed.
  • Loading branch information
mgedmin committed Oct 21, 2017
1 parent 1467426 commit 2cf78fa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/zope/server/http/httptask.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,12 @@ def getCGIEnvironment(self):
if remote_host is not None:
env['REMOTE_HOST'] = remote_host

env_has = env.has_key

for key, value in request_data.headers.items():
value = value.strip()
mykey = rename_headers.get(key, None)
if mykey is None:
mykey = 'HTTP_%s' % key
if not env_has(mykey):
if mykey not in env:
env[mykey] = value

self.cgi_env = env
Expand Down

0 comments on commit 2cf78fa

Please sign in to comment.