From 2537ab0dc2d416c323fcc5169698b63eee256324 Mon Sep 17 00:00:00 2001 From: "Michael P. Soulier" Date: Tue, 5 Jul 2016 18:24:18 -0400 Subject: Fixing some python3 syntax errors --- t/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/test.py b/t/test.py index d41a00c..197bd45 100644 --- a/t/test.py +++ b/t/test.py @@ -382,7 +382,7 @@ class TestTftpyState(unittest.TestCase): try: server.listen('localhost', 20001) log.error("server didn't throw exception") - except Exception, err: + except Exception as err: log.error("server got unexpected exception %s" % err) # Wait until parent kills us while True: @@ -424,7 +424,7 @@ class TestTftpyState(unittest.TestCase): signal.alarm(2) try: server.listen('localhost', 20001) - except Exception, err: + except Exception as err: log.error("server threw exception %s" % err) # Wait until parent kills us while True: -- cgit v1.2.1 From a68924f2a66916b2d967b011d981259752556ae4 Mon Sep 17 00:00:00 2001 From: "Michael P. Soulier" Date: Wed, 6 Jul 2016 07:20:21 -0400 Subject: Fixing obvious python3 errors. Timeouts still not working. --- t/test.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 't') diff --git a/t/test.py b/t/test.py index 197bd45..2bb514c 100644 --- a/t/test.py +++ b/t/test.py @@ -25,8 +25,8 @@ class TestTftpyClasses(unittest.TestCase): rrq.encode() self.assert_(rrq.buffer != None, "Buffer populated") rrq.decode() - self.assertEqual(rrq.filename, "myfilename", "Filename correct") - self.assertEqual(rrq.mode, "octet", "Mode correct") + self.assertEqual(rrq.filename, b"myfilename", "Filename correct") + self.assertEqual(rrq.mode, b"octet", "Mode correct") self.assertEqual(rrq.options, options, "Options correct") # repeat test with options rrq.options = { 'blksize': '1024' } @@ -35,8 +35,8 @@ class TestTftpyClasses(unittest.TestCase): rrq.encode() self.assert_(rrq.buffer != None, "Buffer populated") rrq.decode() - self.assertEqual(rrq.filename, "myfilename", "Filename correct") - self.assertEqual(rrq.mode, "octet", "Mode correct") + self.assertEqual(rrq.filename, b"myfilename", "Filename correct") + self.assertEqual(rrq.mode, b"octet", "Mode correct") self.assertEqual(rrq.options['blksize'], '1024', "Blksize correct") def testTftpPacketWRQ(self): @@ -50,8 +50,8 @@ class TestTftpyClasses(unittest.TestCase): self.assert_(wrq.buffer != None, "Buffer populated") wrq.decode() self.assertEqual(wrq.opcode, 2, "Opcode correct") - self.assertEqual(wrq.filename, "myfilename", "Filename correct") - self.assertEqual(wrq.mode, "octet", "Mode correct") + self.assertEqual(wrq.filename, b"myfilename", "Filename correct") + self.assertEqual(wrq.mode, b"octet", "Mode correct") self.assertEqual(wrq.options, options, "Options correct") # repeat test with options wrq.options = { 'blksize': '1024' } @@ -61,8 +61,8 @@ class TestTftpyClasses(unittest.TestCase): self.assert_(wrq.buffer != None, "Buffer populated") wrq.decode() self.assertEqual(wrq.opcode, 2, "Opcode correct") - self.assertEqual(wrq.filename, "myfilename", "Filename correct") - self.assertEqual(wrq.mode, "octet", "Mode correct") + self.assertEqual(wrq.filename, b"myfilename", "Filename correct") + self.assertEqual(wrq.mode, b"octet", "Mode correct") self.assertEqual(wrq.options['blksize'], '1024', "Blksize correct") -- cgit v1.2.1