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
a7a4c414
Kaydet (Commit)
a7a4c414
authored
Tem 31, 2015
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge 3.4 (asyncio)
üst
b20ac4df
6fb1e740
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
base_subprocess.py
Lib/asyncio/base_subprocess.py
+7
-2
test_subprocess.py
Lib/test/test_asyncio/test_subprocess.py
+15
-0
No files found.
Lib/asyncio/base_subprocess.py
Dosyayı görüntüle @
a7a4c414
...
@@ -35,8 +35,13 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
...
@@ -35,8 +35,13 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
self
.
_pipes
[
2
]
=
None
self
.
_pipes
[
2
]
=
None
# Create the child process: set the _proc attribute
# Create the child process: set the _proc attribute
self
.
_start
(
args
=
args
,
shell
=
shell
,
stdin
=
stdin
,
stdout
=
stdout
,
try
:
stderr
=
stderr
,
bufsize
=
bufsize
,
**
kwargs
)
self
.
_start
(
args
=
args
,
shell
=
shell
,
stdin
=
stdin
,
stdout
=
stdout
,
stderr
=
stderr
,
bufsize
=
bufsize
,
**
kwargs
)
except
:
self
.
close
()
raise
self
.
_pid
=
self
.
_proc
.
pid
self
.
_pid
=
self
.
_proc
.
pid
self
.
_extra
[
'subprocess'
]
=
self
.
_proc
self
.
_extra
[
'subprocess'
]
=
self
.
_proc
...
...
Lib/test/test_asyncio/test_subprocess.py
Dosyayı görüntüle @
a7a4c414
import
signal
import
signal
import
sys
import
sys
import
unittest
import
unittest
import
warnings
from
unittest
import
mock
from
unittest
import
mock
import
asyncio
import
asyncio
...
@@ -413,6 +414,20 @@ class SubprocessMixin:
...
@@ -413,6 +414,20 @@ class SubprocessMixin:
# the transport was not notified yet
# the transport was not notified yet
self
.
assertFalse
(
killed
)
self
.
assertFalse
(
killed
)
def
test_popen_error
(
self
):
# Issue #24763: check that the subprocess transport is closed
# when BaseSubprocessTransport fails
with
mock
.
patch
(
'subprocess.Popen'
)
as
popen
:
exc
=
ZeroDivisionError
popen
.
side_effect
=
exc
create
=
asyncio
.
create_subprocess_exec
(
sys
.
executable
,
'-c'
,
'pass'
,
loop
=
self
.
loop
)
with
warnings
.
catch_warnings
(
record
=
True
)
as
warns
:
with
self
.
assertRaises
(
exc
):
self
.
loop
.
run_until_complete
(
create
)
self
.
assertEqual
(
warns
,
[])
if
sys
.
platform
!=
'win32'
:
if
sys
.
platform
!=
'win32'
:
# Unix
# Unix
...
...
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