Disconnect and reconnect in exclusive mode PCSCCardconnections.

def connect(self, protocol=None, mode=None, disposition=None):
        '''Disconnect and reconnect in exclusive mode PCSCCardconnections.'''
        CardConnectionDecorator.connect(self, protocol, mode, disposition)
        component = self.component
        while True:
            if isinstance(component,
                          smartcard.pcsc.PCSCCardConnection.PCSCCardConnection):
                pcscprotocol = PCSCCardConnection.translateprotocolmask(
                    protocol)
                if 0 == pcscprotocol:
                    pcscprotocol = component.getProtocol()

                if component.hcard is not None:
                    hresult = SCardDisconnect(component.hcard,
                                              SCARD_LEAVE_CARD)
                    if hresult != 0:
                        raise CardConnectionException(
                                'Failed to disconnect: ' +
                                SCardGetErrorMessage(hresult))
                hresult, component.hcard, dwActiveProtocol = SCardConnect(
                    component.hcontext, str(component.reader),
                    SCARD_SHARE_EXCLUSIVE, pcscprotocol)
                if hresult != 0:
                    raise CardConnectionException(
                        'Failed to connect with SCARD_SHARE_EXCLUSIVE' +
                        SCardGetErrorMessage(hresult))
                # print('reconnected exclusive')
                break
            if hasattr(component, 'component'):
                component = component.component
            else:
                break