connectors/PYRO/PSK_Adapter.py
changeset 2536 2747d6e72eb8
parent 2492 7dd551ac2fa0
child 2537 eb4a4cc41914
equal deleted inserted replaced
2535:0fab0af57950 2536:2747d6e72eb8
    35 
    35 
    36                 conn = TCPConnection(sock, sock.getpeername())
    36                 conn = TCPConnection(sock, sock.getpeername())
    37                 # receive the authentication challenge string, and use that to build the actual identification string.
    37                 # receive the authentication challenge string, and use that to build the actual identification string.
    38                 try:
    38                 try:
    39                     authChallenge = self.recvAuthChallenge(conn)
    39                     authChallenge = self.recvAuthChallenge(conn)
    40                 except ProtocolError, x:
    40                 except ProtocolError as x:
    41                     # check if we were denied
    41                     # check if we were denied
    42                     if hasattr(x, "partialMsg") and x.partialMsg[:len(self.denyMSG)] == self.denyMSG:
    42                     if hasattr(x, "partialMsg") and x.partialMsg[:len(self.denyMSG)] == self.denyMSG:
    43                         raise ConnectionDeniedError(Pyro.constants.deniedReasons[int(x.partialMsg[-1])])
    43                         raise ConnectionDeniedError(Pyro.constants.deniedReasons[int(x.partialMsg[-1])])
    44                     else:
    44                     else:
    45                         raise
    45                         raise