]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Replace the deprecated ConfigParser.readfp() method, and fix the incomplete merge...
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 15 Aug 2010 20:16:27 +0000 (20:16 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sun, 15 Aug 2010 20:16:27 +0000 (20:16 +0000)
Lib/logging/config.py
Lib/test/test_logging.py

index 63193b1c7f8d8ccd0c5cfe60a7016b843ab34e7d..c90591b9fe36fa2843567e6d1053a2f87a0581fe 100644 (file)
@@ -63,7 +63,7 @@ def fileConfig(fname, defaults=None, disable_existing_loggers=True):
 
     cp = configparser.ConfigParser(defaults)
     if hasattr(fname, 'readline'):
-        cp.readfp(fname)
+        cp.read_file(fname)
     else:
         cp.read(fname)
 
index d7634593dcb03dc51b3666d98a998edd4840295b..511b2e058bfb42e0b0ce3fb044e902682522bd61 100644 (file)
@@ -38,8 +38,7 @@ from socketserver import ThreadingTCPServer, StreamRequestHandler
 import struct
 import sys
 import tempfile
-from test.support import captured_stdout, run_with_locale, run_unittest,\
-     find_unused_port
+from test.support import captured_stdout, run_with_locale, run_unittest
 import textwrap
 import unittest
 import warnings
@@ -1666,8 +1665,8 @@ class ConfigDictTest(BaseTest):
     @unittest.skipUnless(threading, 'listen() needs threading to work')
     def setup_via_listener(self, text):
         text = text.encode("utf-8")
-        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