]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
SF Patch #638825
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 15 Nov 2002 23:33:20 +0000 (23:33 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 15 Nov 2002 23:33:20 +0000 (23:33 +0000)
Fix pychecker warnings, port arg was unused (it was always the default)
Need a global statement for _listener

Lib/logging/config.py

index 4a7832b455e4004d0287e21758b90c99a5e23aa1..3d342f413d5946a7918730312953b9b7a0ab697e 100644 (file)
@@ -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