Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3df053e5
Kaydet (Commit)
3df053e5
authored
Eki 07, 2016
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.5 (asyncio)
üst
ac5084b6
36e7e97d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
unix_events.py
Lib/asyncio/unix_events.py
+9
-2
test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+10
-1
No files found.
Lib/asyncio/unix_events.py
Dosyayı görüntüle @
3df053e5
...
...
@@ -234,6 +234,11 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
else
:
if
sock
is
None
:
raise
ValueError
(
'no path and sock were specified'
)
if
(
sock
.
family
!=
socket
.
AF_UNIX
or
sock
.
type
!=
socket
.
SOCK_STREAM
):
raise
ValueError
(
'A UNIX Domain Stream Socket was expected, got {!r}'
.
format
(
sock
))
sock
.
setblocking
(
False
)
transport
,
protocol
=
yield
from
self
.
_create_connection_transport
(
...
...
@@ -272,9 +277,11 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
raise
ValueError
(
'path was not specified, and no sock specified'
)
if
sock
.
family
!=
socket
.
AF_UNIX
:
if
(
sock
.
family
!=
socket
.
AF_UNIX
or
sock
.
type
!=
socket
.
SOCK_STREAM
):
raise
ValueError
(
'A UNIX Domain Socket was expected, got {!r}'
.
format
(
sock
))
'A UNIX Domain Stream Socket was expected, got {!r}'
.
format
(
sock
))
server
=
base_events
.
Server
(
self
,
[
sock
])
sock
.
listen
(
backlog
)
...
...
Lib/test/test_asyncio/test_unix_events.py
Dosyayı görüntüle @
3df053e5
...
...
@@ -273,7 +273,16 @@ class SelectorEventLoopUnixSocketTests(test_utils.TestCase):
coro
=
self
.
loop
.
create_unix_server
(
lambda
:
None
,
path
=
None
,
sock
=
sock
)
with
self
.
assertRaisesRegex
(
ValueError
,
'A UNIX Domain Socket was expected'
):
'A UNIX Domain Stream.*was expected'
):
self
.
loop
.
run_until_complete
(
coro
)
def
test_create_unix_connection_path_inetsock
(
self
):
sock
=
socket
.
socket
()
with
sock
:
coro
=
self
.
loop
.
create_unix_connection
(
lambda
:
None
,
path
=
None
,
sock
=
sock
)
with
self
.
assertRaisesRegex
(
ValueError
,
'A UNIX Domain Stream.*was expected'
):
self
.
loop
.
run_until_complete
(
coro
)
@mock.patch
(
'asyncio.unix_events.socket'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment