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
02e7dfde
Kaydet (Commit)
02e7dfde
authored
Ara 28, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
üst
fe8df4fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
subprocess.py
Lib/subprocess.py
+6
-4
No files found.
Lib/subprocess.py
Dosyayı görüntüle @
02e7dfde
...
@@ -136,7 +136,8 @@ check_output(*popenargs, **kwargs):
...
@@ -136,7 +136,8 @@ check_output(*popenargs, **kwargs):
The arguments are the same as for the Popen constructor. Example:
The arguments are the same as for the Popen constructor. Example:
output = subprocess.check_output(["ls", "-l", "/dev/null"])
output = check_output(["ls", "-l", "/dev/null"])
Exceptions
Exceptions
----------
----------
...
@@ -462,7 +463,8 @@ _active = []
...
@@ -462,7 +463,8 @@ _active = []
def
_cleanup
():
def
_cleanup
():
for
inst
in
_active
[:]:
for
inst
in
_active
[:]:
if
inst
.
_internal_poll
(
_deadstate
=
sys
.
maxint
)
>=
0
:
res
=
inst
.
_internal_poll
(
_deadstate
=
sys
.
maxint
)
if
res
is
not
None
and
res
>=
0
:
try
:
try
:
_active
.
remove
(
inst
)
_active
.
remove
(
inst
)
except
ValueError
:
except
ValueError
:
...
@@ -517,11 +519,11 @@ def check_output(*popenargs, **kwargs):
...
@@ -517,11 +519,11 @@ def check_output(*popenargs, **kwargs):
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n'
The stdout argument is not allowed as it is used internally.
The stdout argument is not allowed as it is used internally.
To capture standard error in the result, use stderr=
subprocess.
STDOUT.
To capture standard error in the result, use stderr=STDOUT.
>>> check_output(["/bin/sh", "-c",
>>> check_output(["/bin/sh", "-c",
... "ls -l non_existent_file ; exit 0"],
... "ls -l non_existent_file ; exit 0"],
... stderr=
subprocess.
STDOUT)
... stderr=STDOUT)
'ls: non_existent_file: No such file or directory\n'
'ls: non_existent_file: No such file or directory\n'
"""
"""
if
'stdout'
in
kwargs
:
if
'stdout'
in
kwargs
:
...
...
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