File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- from typing import Mapping , Optional
1+ from types import TracebackType
2+ from typing import Mapping , Optional , Type
23
34from ..config import ClientConfig
45from ..transport .async_transport import AsyncTransport
@@ -44,8 +45,13 @@ def __init__(
4445 async def close (self ) -> None :
4546 await self .transport .close ()
4647
47- async def __aenter__ (self ):
48+ async def __aenter__ (self ) -> "AsyncHyperbrowser" :
4849 return self
4950
50- async def __aexit__ (self , exc_type , exc_val , exc_tb ):
51+ async def __aexit__ (
52+ self ,
53+ exc_type : Optional [Type [BaseException ]],
54+ exc_val : Optional [BaseException ],
55+ exc_tb : Optional [TracebackType ],
56+ ) -> None :
5157 await self .close ()
Original file line number Diff line number Diff line change 1- from typing import Mapping , Optional
1+ from types import TracebackType
2+ from typing import Mapping , Optional , Type
23
34from ..config import ClientConfig
45from ..transport .sync import SyncTransport
@@ -44,8 +45,13 @@ def __init__(
4445 def close (self ) -> None :
4546 self .transport .close ()
4647
47- def __enter__ (self ):
48+ def __enter__ (self ) -> "Hyperbrowser" :
4849 return self
4950
50- def __exit__ (self , exc_type , exc_val , exc_tb ):
51+ def __exit__ (
52+ self ,
53+ exc_type : Optional [Type [BaseException ]],
54+ exc_val : Optional [BaseException ],
55+ exc_tb : Optional [TracebackType ],
56+ ) -> None :
5157 self .close ()
You can’t perform that action at this time.
0 commit comments