mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
SF Patch #638825
Fix pychecker warnings, port arg was unused (it was always the default) Need a global statement for _listener
This commit is contained in:
parent
d1cade0d1f
commit
c4d047aad3
1 changed files with 7 additions and 4 deletions
|
@ -271,20 +271,23 @@ def listen(port=DEFAULT_LOGGING_CONFIG_PORT):
|
||||||
abort = self.abort
|
abort = self.abort
|
||||||
logging._releaseLock()
|
logging._releaseLock()
|
||||||
|
|
||||||
def serve(rcvr, hdlr):
|
def serve(rcvr, hdlr, port):
|
||||||
server = rcvr(handler=hdlr)
|
server = rcvr(port=port, handler=hdlr)
|
||||||
global _listener
|
global _listener
|
||||||
logging._acquireLock()
|
logging._acquireLock()
|
||||||
_listener = server
|
_listener = server
|
||||||
logging._releaseLock()
|
logging._releaseLock()
|
||||||
server.serve_until_stopped()
|
server.serve_until_stopped()
|
||||||
|
|
||||||
return threading.Thread(target=serve, args=(ConfigSocketReceiver, ConfigStreamHandler))
|
return threading.Thread(target=serve,
|
||||||
|
args=(ConfigSocketReceiver,
|
||||||
|
ConfigStreamHandler, port))
|
||||||
|
|
||||||
def stopListening():
|
def stopListening():
|
||||||
"""
|
"""
|
||||||
Stop the listening server which was created with a call to listen().
|
Stop the listening server which was created with a call to listen().
|
||||||
"""
|
"""
|
||||||
|
global _listener
|
||||||
if _listener:
|
if _listener:
|
||||||
logging._acquireLock()
|
logging._acquireLock()
|
||||||
_listener.abort = 1
|
_listener.abort = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue