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
a4024e2d
Kaydet (Commit)
a4024e2d
authored
Eyl 24, 2010
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Make _kill_process more robust under Windows too (see issue #8432)
üst
ff09ce21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
test_subprocess.py
Lib/test/test_subprocess.py
+14
-20
No files found.
Lib/test/test_subprocess.py
Dosyayı görüntüle @
a4024e2d
...
...
@@ -1000,28 +1000,22 @@ class Win32ProcessTestCase(BaseTestCase):
def
_kill_process
(
self
,
method
,
*
args
):
# Some win32 buildbot raises EOFError if stdin is inherited
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
"input()"
],
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
# Let the process initialize (Issue #3137)
time
.
sleep
(
0.1
)
# The process should not terminate prematurely
self
.
assertIsNone
(
p
.
poll
())
# Retry if the process do not receive the signal.
count
,
maxcount
=
0
,
3
while
count
<
maxcount
and
p
.
poll
()
is
None
:
getattr
(
p
,
method
)(
*
args
)
time
.
sleep
(
0.1
)
count
+=
1
returncode
=
p
.
poll
()
self
.
assertIsNotNone
(
returncode
,
"the subprocess did not terminate"
)
if
count
>
1
:
print
(
"p.{}{} succeeded after "
"{} attempts"
.
format
(
method
,
args
,
count
),
file
=
sys
.
stderr
)
p
=
subprocess
.
Popen
([
sys
.
executable
,
"-c"
,
"""if 1:
import sys, time
sys.stdout.write('x
\\
n')
sys.stdout.flush()
time.sleep(30)
"""
],
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
# Wait for the interpreter to be completely initialized before
# sending any signal.
p
.
stdout
.
read
(
1
)
getattr
(
p
,
method
)(
*
args
)
_
,
stderr
=
p
.
communicate
()
self
.
assertStderrEqual
(
stderr
,
b
''
)
self
.
assertEqual
(
p
.
wait
(),
returncode
)
returncode
=
p
.
wait
(
)
self
.
assertNotEqual
(
returncode
,
0
)
def
test_send_signal
(
self
):
...
...
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