(
        self,
        exc_type: Optional[Type[Exception]],
        exc_value: Optional[Exception],
        traceback: Optional[TracebackType],
    )
return None
Exit the context manager.

        Args:
            exc_type:
                Raised exception type. :obj:`None` if nothing is raised.
            exc_value:
                Raised exception object. :obj:`None` if nothing is raised.
            traceback:
                Associated traceback. :obj:`None` if nothing is raised.

        Returns:
            :obj:`None` if nothing is deferred, otherwise :obj:`True`.
            :obj:`True` will suppress any exceptions avoiding them from propagating.
Exit the context manager.
Exit the context manager .
def __exit__(
        self,
        exc_type: Optional[Type[Exception]],
        exc_value: Optional[Exception],
        traceback: Optional[TracebackType],
    ) -> Optional[bool]:
        """Exit the context manager.

        Args:
            exc_type:
                Raised exception type. :obj:`None` if nothing is raised.
            exc_value:
                Raised exception object. :obj:`None` if nothing is raised.
            traceback:
                Associated traceback. :obj:`None` if nothing is raised.

        Returns:
            :obj:`None` if nothing is deferred, otherwise :obj:`True`.
            :obj:`True` will suppress any exceptions avoiding them from propagating.

        """
        if isinstance(exc_value, (ImportError, SyntaxError)):
            if isinstance(exc_value, ImportError):
                message = (
                    "Tried to import '{}' but failed. Please make sure that the package is "
                    "installed correctly to use this feature. Actual error: {}."
                ).format(exc_value.name, exc_value)
            elif isinstance(exc_value, SyntaxError):
                message = (
                    "Tried to import a package but failed due to a syntax error in {}. Please "
                    "make sure that the Python version is correct to use this feature. Actual "
                    "error: {}."
                ).format(exc_value.filename, exc_value)
            else:
                assert False

            self._deferred = (exc_value, message)
            return True
        return None
def __exit__ ( self , exc_type : Optional [ Type [ Exception ] ] , exc_value : Optional [ Exception ] , traceback : Optional [ TracebackType ] , ) -> Optional [ bool ] : if isinstance ( exc_value , ( ImportError , SyntaxError ) ) : if isinstance ( exc_value , ImportError ) : message = ( "Tried to import '{}' but failed. Please make sure that the package is " "installed correctly to use this feature. Actual error: {}." ) . format ( exc_value . name , exc_value ) elif isinstance ( exc_value , SyntaxError ) : message = ( "Tried to import a package but failed due to a syntax error in {}. Please " "make sure that the Python version is correct to use this feature. Actual " "error: {}." ) . format ( exc_value . filename , exc_value ) else : assert False self . _deferred = ( exc_value , message ) return True return None