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
aaabc4fd
Kaydet (Commit)
aaabc4fd
authored
Ock 29, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: Get rid of _try_connected().
üst
47fb97e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
18 deletions
+14
-18
base_subprocess.py
Lib/asyncio/base_subprocess.py
+14
-18
No files found.
Lib/asyncio/base_subprocess.py
Dosyayı görüntüle @
aaabc4fd
...
@@ -75,19 +75,27 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
...
@@ -75,19 +75,27 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
proc
=
self
.
_proc
proc
=
self
.
_proc
loop
=
self
.
_loop
loop
=
self
.
_loop
if
proc
.
stdin
is
not
None
:
if
proc
.
stdin
is
not
None
:
transp
,
proto
=
yield
from
loop
.
connect_write_pipe
(
_
,
pipe
=
yield
from
loop
.
connect_write_pipe
(
lambda
:
WriteSubprocessPipeProto
(
self
,
STDIN
),
lambda
:
WriteSubprocessPipeProto
(
self
,
STDIN
),
proc
.
stdin
)
proc
.
stdin
)
self
.
_pipes
[
STDIN
]
=
pipe
if
proc
.
stdout
is
not
None
:
if
proc
.
stdout
is
not
None
:
transp
,
proto
=
yield
from
loop
.
connect_read_pipe
(
_
,
pipe
=
yield
from
loop
.
connect_read_pipe
(
lambda
:
ReadSubprocessPipeProto
(
self
,
STDOUT
),
lambda
:
ReadSubprocessPipeProto
(
self
,
STDOUT
),
proc
.
stdout
)
proc
.
stdout
)
self
.
_pipes
[
STDOUT
]
=
pipe
if
proc
.
stderr
is
not
None
:
if
proc
.
stderr
is
not
None
:
transp
,
proto
=
yield
from
loop
.
connect_read_pipe
(
_
,
pipe
=
yield
from
loop
.
connect_read_pipe
(
lambda
:
ReadSubprocessPipeProto
(
self
,
STDERR
),
lambda
:
ReadSubprocessPipeProto
(
self
,
STDERR
),
proc
.
stderr
)
proc
.
stderr
)
if
not
self
.
_pipes
:
self
.
_pipes
[
STDERR
]
=
pipe
self
.
_try_connected
()
assert
self
.
_pending_calls
is
not
None
self
.
_loop
.
call_soon
(
self
.
_protocol
.
connection_made
,
self
)
for
callback
,
data
in
self
.
_pending_calls
:
self
.
_loop
.
call_soon
(
callback
,
*
data
)
self
.
_pending_calls
=
None
def
_call
(
self
,
cb
,
*
data
):
def
_call
(
self
,
cb
,
*
data
):
if
self
.
_pending_calls
is
not
None
:
if
self
.
_pending_calls
is
not
None
:
...
@@ -95,14 +103,6 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
...
@@ -95,14 +103,6 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
else
:
else
:
self
.
_loop
.
call_soon
(
cb
,
*
data
)
self
.
_loop
.
call_soon
(
cb
,
*
data
)
def
_try_connected
(
self
):
assert
self
.
_pending_calls
is
not
None
if
all
(
p
is
not
None
and
p
.
connected
for
p
in
self
.
_pipes
.
values
()):
self
.
_loop
.
call_soon
(
self
.
_protocol
.
connection_made
,
self
)
for
callback
,
data
in
self
.
_pending_calls
:
self
.
_loop
.
call_soon
(
callback
,
*
data
)
self
.
_pending_calls
=
None
def
_pipe_connection_lost
(
self
,
fd
,
exc
):
def
_pipe_connection_lost
(
self
,
fd
,
exc
):
self
.
_call
(
self
.
_protocol
.
pipe_connection_lost
,
fd
,
exc
)
self
.
_call
(
self
.
_protocol
.
pipe_connection_lost
,
fd
,
exc
)
self
.
_try_finish
()
self
.
_try_finish
()
...
@@ -136,19 +136,15 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
...
@@ -136,19 +136,15 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
class
WriteSubprocessPipeProto
(
protocols
.
BaseProtocol
):
class
WriteSubprocessPipeProto
(
protocols
.
BaseProtocol
):
pipe
=
None
def
__init__
(
self
,
proc
,
fd
):
def
__init__
(
self
,
proc
,
fd
):
self
.
proc
=
proc
self
.
proc
=
proc
self
.
fd
=
fd
self
.
fd
=
fd
self
.
connected
=
Fals
e
self
.
pipe
=
Non
e
self
.
disconnected
=
False
self
.
disconnected
=
False
proc
.
_pipes
[
fd
]
=
self
def
connection_made
(
self
,
transport
):
def
connection_made
(
self
,
transport
):
self
.
connected
=
True
self
.
pipe
=
transport
self
.
pipe
=
transport
self
.
proc
.
_try_connected
()
def
connection_lost
(
self
,
exc
):
def
connection_lost
(
self
,
exc
):
self
.
disconnected
=
True
self
.
disconnected
=
True
...
...
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