Fix syntax errors with python 2.6. https://bugs.gentoo.org/265784 --- a/khashmir/inserter.py +++ b/khashmir/inserter.py @@ -28,7 +28,6 @@ def d(n): done = done+1 if __name__=="__main__": - global done host, port = sys.argv[1:] x = UTKhashmir("", 22038, "/tmp/cgcgcgc") x.addContact(host, int(port)) --- a/khashmir/test_krpc.py +++ b/khashmir/test_krpc.py @@ -44,20 +44,20 @@ class KRPCTests(TestCase): self.r = RawServer(Event(), d) addr = ('127.0.0.1', 1180) - self.as = self.r.create_udpsocket(addr[1], addr[0], True) + self.asock = self.r.create_udpsocket(addr[1], addr[0], True) self.af = Receiver(addr) - self.a = hostbroker(self.af, addr, self.as, self.r.add_task) - self.r.start_listening_udp(self.as, self.a) + self.a = hostbroker(self.af, addr, self.asock, self.r.add_task) + self.r.start_listening_udp(self.asock, self.a) addr = ('127.0.0.1', 1181) - self.bs = self.r.create_udpsocket(addr[1], addr[0], True) + self.bsock = self.r.create_udpsocket(addr[1], addr[0], True) self.bf = Receiver(addr) - self.b = hostbroker(self.bf, addr, self.bs, self.r.add_task) - self.r.start_listening_udp(self.bs, self.b) + self.b = hostbroker(self.bf, addr, self.bsock, self.r.add_task) + self.r.start_listening_udp(self.bsock, self.b) def tearDown(self): - self.as.close() - self.bs.close() + self.asock.close() + self.bsock.close() def testSimpleMessage(self): self.noisy = 0