summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-11-15 23:33:20 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-11-15 23:33:20 (GMT)
commitc4d047aad330509a0fc052f2da08ff171afd6ea4 (patch)
tree144ad7f36c13117be787b339072075a837c6ab44
parentd1cade0d1f7aa00f3659f28cdb70ca5e751c3902 (diff)
downloadcpython-c4d047aad330509a0fc052f2da08ff171afd6ea4.zip
cpython-c4d047aad330509a0fc052f2da08ff171afd6ea4.tar.gz
cpython-c4d047aad330509a0fc052f2da08ff171afd6ea4.tar.bz2
SF Patch #638825
Fix pychecker warnings, port arg was unused (it was always the default) Need a global statement for _listener
-rw-r--r--Lib/logging/config.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/logging/config.py b/Lib/logging/config.py
index 4a7832b..3d342f4 100644
--- a/Lib/logging/config.py
+++ b/Lib/logging/config.py
@@ -251,7 +251,7 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
allow_reuse_address = 1
def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
- handler=None):
+ handler=None):
ThreadingTCPServer.__init__(self, (host, port), handler)
logging._acquireLock()
self.abort = 0
@@ -271,20 +271,23 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
abort = self.abort
logging._releaseLock()
- def serve(rcvr, hdlr):
- server = rcvr(handler=hdlr)
+ def serve(rcvr, hdlr, port):
+ server = rcvr(port=port, handler=hdlr)
global _listener
logging._acquireLock()
_listener = server
logging._releaseLock()
server.serve_until_stopped()
- return threading.Thread(target=serve, args=(ConfigSocketReceiver, ConfigStreamHandler))
+ return threading.Thread(target=serve,
+ args=(ConfigSocketReceiver,
+ ConfigStreamHandler, port))
def stopListening():
"""
Stop the listening server which was created with a call to listen().
"""
+ global _listener
if _listener:
logging._acquireLock()
_listener.abort = 1