]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix testsuite failure when sockets is not defined 1725/head
authorGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Tue, 24 May 2016 10:29:51 +0000 (12:29 +0200)
committerGianfranco Costamagna <costamagnagianfranco@yahoo.it>
Tue, 24 May 2016 10:29:51 +0000 (12:29 +0200)
this fixes the UnboundLocalError issue
"UnboundLocalError: local variable 'sockets' referenced before assignment"
Thanks Ondřej Nový for the help

tornado/test/netutil_test.py

index 70d969499fa433a13c27cad5475dad0fe10ed605..2f4207a3e557c29a5742bd2f07aab27cb7c47167 100644 (file)
@@ -204,6 +204,7 @@ class TestPortAllocation(unittest.TestCase):
 
     @unittest.skipIf(not hasattr(socket, "SO_REUSEPORT"), "SO_REUSEPORT is not supported")
     def test_reuse_port(self):
+        sockets = []
         socket, port = bind_unused_port(reuse_port=True)
         try:
             sockets = bind_sockets(port, 'localhost', reuse_port=True)