Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,10 @@ def ready(self, server):
def stop(self):
"""Stop the server and this thread nicely"""
self.docserver.quit = True
self.join()
# explicitly break a reference cycle: DocServer.callback
# has indirectly a reference to ServerThread.
self.docserver = None
self.serving = False
self.url = None

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pydoc: the stop() method of the private ServerThread class now waits until
DocServer.serve_until_quit() completes and then explicitly sets its
docserver attribute to None to break a reference cycle.