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
54c950f6
Kaydet (Commit)
54c950f6
authored
Eki 08, 2010
tarafından
Hirokazu Yamamoto
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9978: Wait until subprocess completes initialization. (Win32KillTests in test_os)
üst
bc95973b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
test_os.py
Lib/test/test_os.py
+14
-2
win_console_handler.py
Lib/test/win_console_handler.py
+6
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_os.py
Dosyayı görüntüle @
54c950f6
...
@@ -13,6 +13,8 @@ import time
...
@@ -13,6 +13,8 @@ import time
import
shutil
import
shutil
from
test
import
support
from
test
import
support
import
contextlib
import
contextlib
import
mmap
import
uuid
# Detect whether we're on a Linux system that uses the (now outdated
# Detect whether we're on a Linux system that uses the (now outdated
# and unmaintained) linuxthreads threading library. There's an issue
# and unmaintained) linuxthreads threading library. There's an issue
...
@@ -1029,13 +1031,23 @@ class Win32KillTests(unittest.TestCase):
...
@@ -1029,13 +1031,23 @@ class Win32KillTests(unittest.TestCase):
self
.
_kill
(
100
)
self
.
_kill
(
100
)
def
_kill_with_event
(
self
,
event
,
name
):
def
_kill_with_event
(
self
,
event
,
name
):
tagname
=
"test_os_
%
s"
%
uuid
.
uuid1
()
m
=
mmap
.
mmap
(
-
1
,
1
,
tagname
)
m
[
0
]
=
0
# Run a script which has console control handling enabled.
# Run a script which has console control handling enabled.
proc
=
subprocess
.
Popen
([
sys
.
executable
,
proc
=
subprocess
.
Popen
([
sys
.
executable
,
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"win_console_handler.py"
)],
"win_console_handler.py"
)
,
tagname
],
creationflags
=
subprocess
.
CREATE_NEW_PROCESS_GROUP
)
creationflags
=
subprocess
.
CREATE_NEW_PROCESS_GROUP
)
# Let the interpreter startup before we send signals. See #3137.
# Let the interpreter startup before we send signals. See #3137.
time
.
sleep
(
0.5
)
count
,
max
=
0
,
20
while
count
<
max
and
proc
.
poll
()
is
None
:
if
m
[
0
]
==
0
:
break
time
.
sleep
(
0.5
)
count
+=
1
else
:
self
.
fail
(
"Subprocess didn't finish initialization"
)
os
.
kill
(
proc
.
pid
,
event
)
os
.
kill
(
proc
.
pid
,
event
)
# proc.send_signal(event) could also be done here.
# proc.send_signal(event) could also be done here.
# Allow time for the signal to be passed and the process to exit.
# Allow time for the signal to be passed and the process to exit.
...
...
Lib/test/win_console_handler.py
Dosyayı görüntüle @
54c950f6
...
@@ -11,6 +11,8 @@ similar example in C.
...
@@ -11,6 +11,8 @@ similar example in C.
from
ctypes
import
wintypes
,
WINFUNCTYPE
from
ctypes
import
wintypes
,
WINFUNCTYPE
import
signal
import
signal
import
ctypes
import
ctypes
import
mmap
import
sys
# Function prototype for the handler function. Returns BOOL, takes a DWORD.
# Function prototype for the handler function. Returns BOOL, takes a DWORD.
HandlerRoutine
=
WINFUNCTYPE
(
wintypes
.
BOOL
,
wintypes
.
DWORD
)
HandlerRoutine
=
WINFUNCTYPE
(
wintypes
.
BOOL
,
wintypes
.
DWORD
)
...
@@ -38,6 +40,10 @@ if __name__ == "__main__":
...
@@ -38,6 +40,10 @@ if __name__ == "__main__":
print
(
"Unable to add SetConsoleCtrlHandler"
)
print
(
"Unable to add SetConsoleCtrlHandler"
)
exit
(
-
1
)
exit
(
-
1
)
# Awaken mail process
m
=
mmap
.
mmap
(
-
1
,
1
,
sys
.
argv
[
1
])
m
[
0
]
=
1
# Do nothing but wait for the signal
# Do nothing but wait for the signal
while
True
:
while
True
:
pass
pass
Misc/NEWS
Dosyayı görüntüle @
54c950f6
...
@@ -311,6 +311,9 @@ Tools/Demos
...
@@ -311,6 +311,9 @@ Tools/Demos
Tests
Tests
-----
-----
- Issue #9978: Wait until subprocess completes initialization. (Win32KillTests
in test_os)
- Issue #7110: regrtest now sends test failure reports and single-failure
- Issue #7110: regrtest now sends test failure reports and single-failure
tracebacks to stderr rather than stdout.
tracebacks to stderr rather than stdout.
...
...
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