diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-05-03 15:11:53 +0000 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-05-03 15:11:53 +0000 |
commit | 27a1370ae0608d083ec1b4162d510cb7ec6a95f5 (patch) | |
tree | 96f09db1c6958ff8ab026308edb19dc6bb218f9d /Lib/test/test_logging.py | |
parent | c1f5c2f3331857898595eb9bd8cf7e195d5fea5b (diff) | |
download | cpython-git-27a1370ae0608d083ec1b4162d510cb7ec6a95f5.tar.gz |
Issue #8576: logging updated to remove usage of find_unused_port().
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r-- | Lib/test/test_logging.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 0211f56074..ed17d15f2e 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -38,8 +38,7 @@ from SocketServer import ThreadingTCPServer, StreamRequestHandler import struct import sys import tempfile -from test.test_support import captured_stdout, run_with_locale, run_unittest,\ - find_unused_port +from test.test_support import captured_stdout, run_with_locale, run_unittest import textwrap import unittest import warnings @@ -1664,10 +1663,12 @@ class ConfigDictTest(BaseTest): @unittest.skipUnless(threading, 'listen() needs threading to work') def setup_via_listener(self, text): - port = find_unused_port() - t = logging.config.listen(port) + # Ask for a randomly assigned port (by using port 0) + t = logging.config.listen(0) t.start() t.ready.wait() + # Now get the port allocated + port = t.port t.ready.clear() try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |