Пример #1
0
 async def close(self, runBeforeUnload: bool = None) -> None:
     try:
         await self._channel.send("close", locals_to_params(locals()))
         if self._owned_context:
             await self._owned_context.close()
     except Exception as e:
         if not is_safe_close_error(e):
             raise e
Пример #2
0
 async def close(self) -> None:
     if self._is_closed_or_closing:
         return
     self._is_closed_or_closing = True
     try:
         await self._channel.send("close")
     except Exception as e:
         if not is_safe_close_error(e):
             raise e