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
77a6b20a
Kaydet (Commit)
77a6b20a
authored
Mar 10, 2015
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #23432: Remove duplicate content from SystemExit docs.
Also, document SystemExit.code attribute explicitly.
üst
47c41b4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
exceptions.rst
Doc/library/exceptions.rst
+13
-13
No files found.
Doc/library/exceptions.rst
Dosyayı görüntüle @
77a6b20a
...
@@ -353,18 +353,17 @@ The following exceptions are the exceptions that are usually raised.
...
@@ -353,18 +353,17 @@ The following exceptions are the exceptions that are usually raised.
.. exception:: SystemExit
.. exception:: SystemExit
This exception is raised by the :func:`sys.exit` function. When it is not
This exception is raised by the :func:`sys.exit` function. It inherits from
handled, the Python interpreter exits; no stack traceback is printed. If the
:exc:`BaseException` instead of :exc:`Exception` so that it is not accidentally
associated value is an integer, it specifies the system exit status (passed
caught by code that catches :exc:`Exception`. This allows the exception to
to C's :c:func:`exit` function); if it is ``None``, the exit status is zero;
properly propagate up and cause the interpreter to exit. When it is not
if it has another type (such as a string), the object's value is printed and
handled, the Python interpreter exits; no stack traceback is printed. The
constructor accepts the same optional argument passed to :func:`sys.exit`.
If the value is an integer, it specifies the system exit status (passed to
C's :c:func:`exit` function); if it is ``None``, the exit status is zero; if
it has another type (such as a string), the object's value is printed and
the exit status is one.
the exit status is one.
Instances have an attribute :attr:`!code` which is set to the proposed exit
status or error message (defaulting to ``None``). Also, this exception derives
directly from :exc:`BaseException` and not :exc:`Exception`, since it is not
technically an error.
A call to :func:`sys.exit` is translated into an exception so that clean-up
A call to :func:`sys.exit` is translated into an exception so that clean-up
handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be
handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be
executed, and so that a debugger can execute a script without running the risk
executed, and so that a debugger can execute a script without running the risk
...
@@ -372,9 +371,10 @@ The following exceptions are the exceptions that are usually raised.
...
@@ -372,9 +371,10 @@ The following exceptions are the exceptions that are usually raised.
absolutely positively necessary to exit immediately (for example, in the child
absolutely positively necessary to exit immediately (for example, in the child
process after a call to :func:`os.fork`).
process after a call to :func:`os.fork`).
The exception inherits from :exc:`BaseException` instead of :exc:`Exception` so
.. attribute:: code
that it is not accidentally caught by code that catches :exc:`Exception`. This
allows the exception to properly propagate up and cause the interpreter to exit.
The exit status or error message that is passed to the constructor.
(Defaults to ``None``.)
.. exception:: TypeError
.. exception:: TypeError
...
...
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