Deleted types in __exit__ methods

This commit is contained in:
Yourun-Proger 2021-08-29 20:14:47 +03:00
parent fafc132dcb
commit 129f13c3b5
3 changed files with 4 additions and 11 deletions

View file

@ -21,6 +21,7 @@ Unreleased
:issue:`4096`
- The CLI loader handles ``**kwargs`` in a ``create_app`` function.
:issue:`4170`
- Removed type-hints in ``__exit__`` methods. :pr:`4250`
Version 2.0.1

View file

@ -1,7 +1,6 @@
import sys
import typing as t
from functools import update_wrapper
from types import TracebackType
from werkzeug.exceptions import HTTPException
@ -257,9 +256,7 @@ class AppContext:
self.push()
return self
def __exit__(
self, exc_type: type, exc_value: BaseException, tb: TracebackType
) -> None:
def __exit__(self, exc_type, exc_value, tb) -> None:
self.pop(exc_value)
@ -463,9 +460,7 @@ class RequestContext:
self.push()
return self
def __exit__(
self, exc_type: type, exc_value: BaseException, tb: TracebackType
) -> None:
def __exit__(self, exc_type, exc_value, tb) -> None:
# do not pop the request stack if we are in debug mode and an
# exception happened. This will allow the debugger to still
# access the request object in the interactive shell. Furthermore

View file

@ -1,7 +1,6 @@
import typing as t
from contextlib import contextmanager
from copy import copy
from types import TracebackType
import werkzeug.test
from click.testing import CliRunner
@ -226,9 +225,7 @@ class FlaskClient(Client):
self.preserve_context = True
return self
def __exit__(
self, exc_type: type, exc_value: BaseException, tb: TracebackType
) -> None:
def __exit__(self, exc_type, exc_value, tb) -> None:
self.preserve_context = False
# Normally the request context is preserved until the next