Skip to content

Commit 5e422f9

Browse files
committed
Update quart for python 3.7 to 3.11
1 parent 7956f6e commit 5e422f9

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

graphql_server/quart/graphqlview.py

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,8 @@ def should_display_graphiql(self):
191191
def request_wants_html():
192192
best = request.accept_mimetypes.best_match(["application/json", "text/html"])
193193

194-
# Needed as this was introduced at Quart 0.8.0: https://gitlab.com/pgjones/quart/-/issues/189
195-
def _quality(accept, key: str) -> float:
196-
for option in accept.options:
197-
if accept._values_match(key, option.value):
198-
return option.quality
199-
return 0.0
200-
201-
if sys.version_info >= (3, 7):
202-
return (
203-
best == "text/html"
204-
and request.accept_mimetypes[best]
205-
> request.accept_mimetypes["application/json"]
206-
)
207-
else:
208-
return best == "text/html" and _quality(
209-
request.accept_mimetypes, best
210-
) > _quality(request.accept_mimetypes, "application/json")
194+
return (
195+
best == "text/html"
196+
and request.accept_mimetypes[best]
197+
> request.accept_mimetypes["application/json"]
198+
)

0 commit comments

Comments
 (0)