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
54d412ed
Kaydet (Commit)
54d412ed
authored
Mar 14, 2011
tarafından
Gregory P. Smith
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a SubprocessError base class for exceptions in the subprocess module.
üst
1c711f0e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
subprocess.rst
Doc/library/subprocess.rst
+5
-0
subprocess.py
Lib/subprocess.py
+9
-4
No files found.
Doc/library/subprocess.rst
Dosyayı görüntüle @
54d412ed
...
...
@@ -387,6 +387,11 @@ All of the functions and methods that accept a *timeout* parameter, such as
:func:`call` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` if
the timeout expires before the process exits.
Exceptions defined in this module all inherit from :ext:`SubprocessError`.
.. versionadded:: 3.3
The :exc:`SubprocessError` base class was added.
Security
^^^^^^^^
...
...
Lib/subprocess.py
Dosyayı görüntüle @
54d412ed
...
...
@@ -191,8 +191,10 @@ should prepare for OSErrors.
A ValueError will be raised if Popen is called with invalid arguments.
check_call() and check_output() will raise CalledProcessError, if the
called process returns a non-zero return code.
Exceptions defined within this module inherit from SubprocessError.
check_call() and check_output() will raise CalledProcessError if the
called process returns a non-zero return code. TimeoutExpired
be raised if a timeout was specified and expired.
Security
...
...
@@ -348,7 +350,10 @@ import builtins
import
warnings
# Exception classes used by this module.
class
CalledProcessError
(
Exception
):
class
SubprocessError
(
Exception
):
pass
class
CalledProcessError
(
SubprocessError
):
"""This exception is raised when a process run by check_call() or
check_output() returns a non-zero exit status.
The exit status will be stored in the returncode attribute;
...
...
@@ -362,7 +367,7 @@ class CalledProcessError(Exception):
return
"Command '
%
s' returned non-zero exit status
%
d"
%
(
self
.
cmd
,
self
.
returncode
)
class
TimeoutExpired
(
Exception
):
class
TimeoutExpired
(
SubprocessError
):
"""This exception is raised when the timeout expires while waiting for a
child process.
"""
...
...
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