From: Gianfranco Costamagna Date: Tue, 24 May 2016 10:29:51 +0000 (+0200) Subject: Fix testsuite failure when sockets is not defined X-Git-Tag: v4.4.0b1~14^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbde7cf184fc34eeb82a905ce755b645a84f3285;p=thirdparty%2Ftornado.git Fix testsuite failure when sockets is not defined this fixes the UnboundLocalError issue "UnboundLocalError: local variable 'sockets' referenced before assignment" Thanks Ondřej Nový for the help --- diff --git a/tornado/test/netutil_test.py b/tornado/test/netutil_test.py index 70d969499..2f4207a3e 100644 --- a/tornado/test/netutil_test.py +++ b/tornado/test/netutil_test.py @@ -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)