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
0068e2cc
Kaydet (Commit)
0068e2cc
authored
Eyl 06, 2007
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New exception catching syntax.
üst
105f60ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
compound_stmts.rst
Doc/reference/compound_stmts.rst
+8
-9
No files found.
Doc/reference/compound_stmts.rst
Dosyayı görüntüle @
0068e2cc
...
@@ -219,13 +219,13 @@ for a group of statements:
...
@@ -219,13 +219,13 @@ for a group of statements:
.. productionlist::
.. productionlist::
try_stmt: try1_stmt | try2_stmt
try_stmt: try1_stmt | try2_stmt
try1_stmt: "try" ":" `suite`
try1_stmt: "try" ":" `suite`
: ("except" [`expression` ["
,
" `target`]] ":" `suite`)+
: ("except" [`expression` ["
as
" `target`]] ":" `suite`)+
: ["else" ":" `suite`]
: ["else" ":" `suite`]
: ["finally" ":" `suite`]
: ["finally" ":" `suite`]
try2_stmt: "try" ":" `suite`
try2_stmt: "try" ":" `suite`
: "finally" ":" `suite`
: "finally" ":" `suite`
The :keyword:`except` clause(s) specify one or more exception handlers. When no
The :keyword:`except` clause(s) specify one or more exception handlers.
When no
exception occurs in the :keyword:`try` clause, no exception handler is executed.
exception occurs in the :keyword:`try` clause, no exception handler is executed.
When an exception occurs in the :keyword:`try` suite, a search for an exception
When an exception occurs in the :keyword:`try` suite, a search for an exception
handler is started. This search inspects the except clauses in turn until one
handler is started. This search inspects the except clauses in turn until one
...
@@ -245,12 +245,12 @@ the new exception in the surrounding code and on the call stack (it is treated
...
@@ -245,12 +245,12 @@ the new exception in the surrounding code and on the call stack (it is treated
as if the entire :keyword:`try` statement raised the exception).
as if the entire :keyword:`try` statement raised the exception).
When a matching except clause is found, the exception is assigned to the target
When a matching except clause is found, the exception is assigned to the target
specified
in that except clause, if present, and the except clause's suite is
specified
after the ``as`` keyword in that except clause, if present, and the
ex
ecuted. All except clauses must have an executable block. When the end of
ex
cept clause's suite is executed. All except clauses must have an executable
this block is reached, execution continues normally after the entire tr
y
block. When the end of this block is reached, execution continues normall
y
statement. (This means that if two nested handlers exist for the same
after the entire try statement. (This means that if two nested handlers exist
exception, and the exception occurs in the try clause of the inner handler, the
for the same exception, and the exception occurs in the try clause of the inner
outer handler will not handle the exception.)
handler, the
outer handler will not handle the exception.)
.. index::
.. index::
module: sys
module: sys
...
@@ -545,4 +545,3 @@ instance variables with different implementation details.
...
@@ -545,4 +545,3 @@ instance variables with different implementation details.
.. [#] Currently, control "flows off the end" except in the case of an exception or the
.. [#] Currently, control "flows off the end" except in the case of an exception or the
execution of a :keyword:`return`, :keyword:`continue`, or :keyword:`break`
execution of a :keyword:`return`, :keyword:`continue`, or :keyword:`break`
statement.
statement.
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