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
f2ed8890
Kaydet (Commit)
f2ed8890
authored
Tem 29, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: Use the new os.set_blocking() function of Python 3.5 if available
üst
3d4953a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
unix_events.py
Lib/asyncio/unix_events.py
+8
-4
test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+6
-6
No files found.
Lib/asyncio/unix_events.py
Dosyayı görüntüle @
f2ed8890
...
...
@@ -259,10 +259,14 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
return
server
def
_set_nonblocking
(
fd
):
flags
=
fcntl
.
fcntl
(
fd
,
fcntl
.
F_GETFL
)
flags
=
flags
|
os
.
O_NONBLOCK
fcntl
.
fcntl
(
fd
,
fcntl
.
F_SETFL
,
flags
)
if
hasattr
(
os
,
'set_blocking'
):
def
_set_nonblocking
(
fd
):
os
.
set_blocking
(
fd
,
False
)
else
:
def
_set_nonblocking
(
fd
):
flags
=
fcntl
.
fcntl
(
fd
,
fcntl
.
F_GETFL
)
flags
=
flags
|
os
.
O_NONBLOCK
fcntl
.
fcntl
(
fd
,
fcntl
.
F_SETFL
,
flags
)
class
_UnixReadPipeTransport
(
transports
.
ReadTransport
):
...
...
Lib/test/test_asyncio/test_unix_events.py
Dosyayı görüntüle @
f2ed8890
...
...
@@ -306,9 +306,9 @@ class UnixReadPipeTransportTests(test_utils.TestCase):
self
.
pipe
=
mock
.
Mock
(
spec_set
=
io
.
RawIOBase
)
self
.
pipe
.
fileno
.
return_value
=
5
fcntl_patcher
=
mock
.
patch
(
'fcntl.fcntl
'
)
fcntl
_patcher
.
start
()
self
.
addCleanup
(
fcntl
_patcher
.
stop
)
blocking_patcher
=
mock
.
patch
(
'asyncio.unix_events._set_nonblocking
'
)
blocking
_patcher
.
start
()
self
.
addCleanup
(
blocking
_patcher
.
stop
)
fstat_patcher
=
mock
.
patch
(
'os.fstat'
)
m_fstat
=
fstat_patcher
.
start
()
...
...
@@ -469,9 +469,9 @@ class UnixWritePipeTransportTests(test_utils.TestCase):
self
.
pipe
=
mock
.
Mock
(
spec_set
=
io
.
RawIOBase
)
self
.
pipe
.
fileno
.
return_value
=
5
fcntl_patcher
=
mock
.
patch
(
'fcntl.fcntl
'
)
fcntl
_patcher
.
start
()
self
.
addCleanup
(
fcntl
_patcher
.
stop
)
blocking_patcher
=
mock
.
patch
(
'asyncio.unix_events._set_nonblocking
'
)
blocking
_patcher
.
start
()
self
.
addCleanup
(
blocking
_patcher
.
stop
)
fstat_patcher
=
mock
.
patch
(
'os.fstat'
)
m_fstat
=
fstat_patcher
.
start
()
...
...
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