mirror of
https://github.com/python/cpython.git
synced 2025-10-02 21:25:24 +00:00
Issue #25931: Don't defining socketserver.Forking* names on platforms such
as Windows that do not support os.fork().
This commit is contained in:
parent
3bad04ca62
commit
cef1f83c71
2 changed files with 14 additions and 6 deletions
|
@ -134,10 +134,12 @@ except ImportError:
|
|||
import dummy_threading as threading
|
||||
from time import monotonic as time
|
||||
|
||||
__all__ = ["BaseServer", "TCPServer", "UDPServer", "ForkingUDPServer",
|
||||
"ForkingTCPServer", "ThreadingUDPServer", "ThreadingTCPServer",
|
||||
__all__ = ["BaseServer", "TCPServer", "UDPServer",
|
||||
"ThreadingUDPServer", "ThreadingTCPServer",
|
||||
"BaseRequestHandler", "StreamRequestHandler",
|
||||
"DatagramRequestHandler", "ThreadingMixIn", "ForkingMixIn"]
|
||||
"DatagramRequestHandler", "ThreadingMixIn"]
|
||||
if hasattr(os, "fork"):
|
||||
__all__.extend(["ForkingUDPServer","ForkingTCPServer", "ForkingMixIn"])
|
||||
if hasattr(socket, "AF_UNIX"):
|
||||
__all__.extend(["UnixStreamServer","UnixDatagramServer",
|
||||
"ThreadingUnixStreamServer",
|
||||
|
@ -537,6 +539,8 @@ class UDPServer(TCPServer):
|
|||
# No need to close anything.
|
||||
pass
|
||||
|
||||
if hasattr(os, "fork"):
|
||||
# Non-standard indentation on this statement to avoid reindenting the body.
|
||||
class ForkingMixIn:
|
||||
|
||||
"""Mix-in class to handle each request in a new process."""
|
||||
|
@ -647,6 +651,7 @@ class ThreadingMixIn:
|
|||
t.start()
|
||||
|
||||
|
||||
if hasattr(os, "fork"):
|
||||
class ForkingUDPServer(ForkingMixIn, UDPServer): pass
|
||||
class ForkingTCPServer(ForkingMixIn, TCPServer): pass
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ Core and Builtins
|
|||
Library
|
||||
-------
|
||||
|
||||
- Issue #25931: Don't defining socketserver.Forking* names on platforms such
|
||||
as Windows that do not support os.fork().
|
||||
|
||||
- Issue #21776: distutils.upload now correctly handles HTTPError.
|
||||
Initial patch by Claudiu Popa.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue