summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2016-11-15 20:27:23 (GMT)
committerYury Selivanov <yury@magic.io>2016-11-15 20:27:23 (GMT)
commit21bb0e6f552c65b1f4128a7468021c0941bc6c18 (patch)
tree13a4a20935621bfb9b31e5238ea42219c74cf9f1 /Lib/asyncio
parent27182bb23229b61edbb40bd321cfdc183065afc4 (diff)
parentd7c151871e4eb445676fbd18bc5cb31406cccdf6 (diff)
downloadcpython-21bb0e6f552c65b1f4128a7468021c0941bc6c18.zip
cpython-21bb0e6f552c65b1f4128a7468021c0941bc6c18.tar.gz
cpython-21bb0e6f552c65b1f4128a7468021c0941bc6c18.tar.bz2
Merge 3.5 (issue #28704)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/unix_events.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py
index 46e91f6..2806ea8 100644
--- a/Lib/asyncio/unix_events.py
+++ b/Lib/asyncio/unix_events.py
@@ -39,6 +39,13 @@ def _sighandler_noop(signum, frame):
pass
+try:
+ _fspath = os.fspath
+except AttributeError:
+ # Python 3.5 or earlier
+ _fspath = lambda path: path
+
+
class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
"""Unix event loop.
@@ -256,6 +263,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)
# Check for abstract socket. `str` and `bytes` paths are supported.