mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447)
This commit is contained in:
parent
895862aa01
commit
423fd362f8
5 changed files with 31 additions and 8 deletions
|
@ -212,7 +212,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
self.call_soon_threadsafe(transp._process_exited, returncode)
|
||||
|
||||
@coroutine
|
||||
def create_unix_connection(self, protocol_factory, path, *,
|
||||
def create_unix_connection(self, protocol_factory, path=None, *,
|
||||
ssl=None, sock=None,
|
||||
server_hostname=None):
|
||||
assert server_hostname is None or isinstance(server_hostname, str)
|
||||
|
@ -229,6 +229,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
raise ValueError(
|
||||
'path and sock can not be specified at the same time')
|
||||
|
||||
path = _fspath(path)
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
|
||||
try:
|
||||
sock.setblocking(False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue