def bindsocket(self): try: uid = os.getuid() except AttributeError: uid = 1 if uid == 0: port = rpc.bindresvport(self.sock, '') # 'port' is not used else: self.sock.bind(('', 0))
def bindsocket(self): import os try: uid = os.getuid() except AttributeError: uid = 1 if uid == 0: port = rpc.bindresvport(self.sock, '') # 'port' is not used else: self.sock.bind(('', 0))