def __exit__(self, exc_type, exc_value, traceback):
        """Clean context

        If ccache is reinitialized, original value of ``KRB5CCNAME`` will be
        restored correctly, if there was. And, lock gets released as well.
        """
        try:
            if self._cleaned_options['ccache'] == DEFAULT_CCACHE:
                if self._original_krb5ccname:
                    os.environ[ENV_KRB5CCNAME] = self._original_krb5ccname
            else:
                if self._original_krb5ccname:
                    os.environ[ENV_KRB5CCNAME] = self._original_krb5ccname
                else:
                    del os.environ[ENV_KRB5CCNAME]

            self._original_krb5ccname = None
        finally:
            self._init_lock.release()
def __exit__ ( self , exc_type , exc_value , traceback ) : try : if self . _cleaned_options [ 'ccache' ] == DEFAULT_CCACHE : if self . _original_krb5ccname : os . environ [ ENV_KRB5CCNAME ] = self . _original_krb5ccname else : if self . _original_krb5ccname : os . environ [ ENV_KRB5CCNAME ] = self . _original_krb5ccname else : del os . environ [ ENV_KRB5CCNAME ] self . _original_krb5ccname = None finally : self . _init_lock . release ( )
Clean context

        If ccache is reinitialized, original value of ``KRB5CCNAME`` will be
        restored correctly, if there was. And, lock gets released as well.