mirror of
https://github.com/python/cpython.git
synced 2025-01-20 15:34:52 +08:00
Replace the deprecated ConfigParser.readfp() method, and fix the incomplete merge in r82293.
This commit is contained in:
parent
a0241c8587
commit
dc692740a8
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user