Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more Python3 compat #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions negotiator/negotiator.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def insert(self, d, q, v):
Utility method: if dict d contains key q, then append value v to the array which is identified by that key
otherwise create a new key with the value of an array with a single value v
"""
if d.has_key(q):
if q in d:
d[q].append(v)
else:
d[q] = [v]
Expand Down Expand Up @@ -694,7 +694,7 @@ def _get_acceptable(self, client, server):

# get the client requirement keys sorted with the highest q first (the server is a list which should be
# in order of preference already)
ckeys = client.keys()
ckeys = list(client.keys())
ckeys.sort(reverse=True)

# the rule for determining what to return is that "the client's preference always wins", so we look for the
Expand Down Expand Up @@ -740,7 +740,7 @@ def _get_acceptable(self, client, server):
# an agreement on what content type they want and can deliver. There's nothing more we can do!
return None

if __name__ == "__main__":
if __name__ == "__main__": # pragma: no cover
"""
Some basic tests to show the code in action
"""
Expand Down
Empty file added tests/__init__.py
Empty file.
Loading