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
0c3949c9
Kaydet (Commit)
0c3949c9
authored
Şub 09, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: Remove Process.subprocess attribute; it's too easy to get inconsistent
Process and Popen objects
üst
313f829c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
29 deletions
+1
-29
asyncio-subprocess.rst
Doc/library/asyncio-subprocess.rst
+1
-5
subprocess.py
Lib/asyncio/subprocess.py
+0
-4
test_subprocess.py
Lib/test/test_asyncio/test_subprocess.py
+0
-20
No files found.
Doc/library/asyncio-subprocess.rst
Dosyayı görüntüle @
0c3949c9
...
@@ -87,10 +87,6 @@ Process
...
@@ -87,10 +87,6 @@ Process
Standard error stream (read), ``None`` if the process was created with
Standard error stream (read), ``None`` if the process was created with
``stderr=None``.
``stderr=None``.
.. attribute:: subprocess
Underlying :class:`subprocess.Popen` object.
.. method:: communicate(input=None)
.. method:: communicate(input=None)
Interact with process: Send data to stdin. Read data from stdout and
Interact with process: Send data to stdin. Read data from stdout and
...
@@ -102,7 +98,7 @@ Process
...
@@ -102,7 +98,7 @@ Process
:meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.
:meth:`communicate` returns a tuple ``(stdoutdata, stderrdata)``.
Note that if you want to send data to the process's stdin, you need to
Note that if you want to send data to the process's stdin, you need to
create the P
open
object with ``stdin=PIPE``. Similarly, to get anything
create the P
rocess
object with ``stdin=PIPE``. Similarly, to get anything
other than ``None`` in the result tuple, you need to give ``stdout=PIPE``
other than ``None`` in the result tuple, you need to give ``stdout=PIPE``
and/or ``stderr=PIPE`` too.
and/or ``stderr=PIPE`` too.
...
...
Lib/asyncio/subprocess.py
Dosyayı görüntüle @
0c3949c9
...
@@ -106,10 +106,6 @@ class Process:
...
@@ -106,10 +106,6 @@ class Process:
yield
from
waiter
yield
from
waiter
return
waiter
.
result
()
return
waiter
.
result
()
@property
def
subprocess
(
self
):
return
self
.
_transport
.
get_extra_info
(
'subprocess'
)
def
_check_alive
(
self
):
def
_check_alive
(
self
):
if
self
.
_transport
.
get_returncode
()
is
not
None
:
if
self
.
_transport
.
get_returncode
()
is
not
None
:
raise
ProcessLookupError
()
raise
ProcessLookupError
()
...
...
Lib/test/test_asyncio/test_subprocess.py
Dosyayı görüntüle @
0c3949c9
...
@@ -7,9 +7,6 @@ from test import support
...
@@ -7,9 +7,6 @@ from test import support
if
sys
.
platform
!=
'win32'
:
if
sys
.
platform
!=
'win32'
:
from
asyncio
import
unix_events
from
asyncio
import
unix_events
# Program exiting quickly
PROGRAM_EXIT_FAST
=
[
sys
.
executable
,
'-c'
,
'pass'
]
# Program blocking
# Program blocking
PROGRAM_BLOCKED
=
[
sys
.
executable
,
'-c'
,
'import time; time.sleep(3600)'
]
PROGRAM_BLOCKED
=
[
sys
.
executable
,
'-c'
,
'import time; time.sleep(3600)'
]
...
@@ -119,23 +116,6 @@ class SubprocessMixin:
...
@@ -119,23 +116,6 @@ class SubprocessMixin:
returncode
=
self
.
loop
.
run_until_complete
(
proc
.
wait
())
returncode
=
self
.
loop
.
run_until_complete
(
proc
.
wait
())
self
.
assertEqual
(
-
signal
.
SIGHUP
,
returncode
)
self
.
assertEqual
(
-
signal
.
SIGHUP
,
returncode
)
def
test_subprocess
(
self
):
args
=
PROGRAM_EXIT_FAST
@asyncio.coroutine
def
run
():
proc
=
yield
from
asyncio
.
create_subprocess_exec
(
*
args
,
loop
=
self
.
loop
)
yield
from
proc
.
wait
()
# need to poll subprocess.Popen, otherwise the returncode
# attribute is not set
proc
.
subprocess
.
wait
()
return
proc
proc
=
self
.
loop
.
run_until_complete
(
run
())
self
.
assertEqual
(
proc
.
subprocess
.
returncode
,
proc
.
returncode
)
self
.
assertEqual
(
proc
.
subprocess
.
pid
,
proc
.
pid
)
def
test_broken_pipe
(
self
):
def
test_broken_pipe
(
self
):
large_data
=
b
'x'
*
support
.
PIPE_MAX_SIZE
large_data
=
b
'x'
*
support
.
PIPE_MAX_SIZE
...
...
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