remove ContextVar compat

This commit is contained in:
David Lord 2021-11-11 16:12:08 -08:00
parent e609dddd60
commit 1b552d0b01
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
6 changed files with 22 additions and 13 deletions

View file

@ -16,7 +16,6 @@ from werkzeug.exceptions import BadRequest
from werkzeug.exceptions import BadRequestKeyError
from werkzeug.exceptions import HTTPException
from werkzeug.exceptions import InternalServerError
from werkzeug.local import ContextVar
from werkzeug.routing import BuildError
from werkzeug.routing import Map
from werkzeug.routing import MapAdapter
@ -1621,13 +1620,6 @@ class Flask(Scaffold):
"Install Flask with the 'async' extra in order to use async views."
) from None
# Check that Werkzeug isn't using its fallback ContextVar class.
if ContextVar.__module__ == "werkzeug.local":
raise RuntimeError(
"Async cannot be used with this combination of Python "
"and Greenlet versions."
)
return asgiref_async_to_sync(func)
def make_response(self, rv: ResponseReturnValue) -> Response: