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
ad29e637
Kaydet (Commit)
ad29e637
authored
Haz 21, 2006
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix [ 1509132 ] compiler module builds incorrect AST for TryExceptFinally
üst
10340608
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
19 deletions
+41
-19
transformer.py
Lib/compiler/transformer.py
+23
-18
NEWS
Misc/NEWS
+18
-1
No files found.
Lib/compiler/transformer.py
Dosyayı görüntüle @
ad29e637
...
...
@@ -536,12 +536,7 @@ class Transformer:
lineno
=
nodelist
[
0
][
2
])
def
try_stmt
(
self
,
nodelist
):
# 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite]
# | 'try' ':' suite 'finally' ':' suite
if
nodelist
[
3
][
0
]
!=
symbol
.
except_clause
:
return
self
.
com_try_finally
(
nodelist
)
return
self
.
com_try_except
(
nodelist
)
return
self
.
com_try_except_finally
(
nodelist
)
def
with_stmt
(
self
,
nodelist
):
return
self
.
com_with
(
nodelist
)
...
...
@@ -917,18 +912,21 @@ class Transformer:
bases
.
append
(
self
.
com_node
(
node
[
i
]))
return
bases
def
com_try_finally
(
self
,
nodelist
):
# try_fin_stmt: "try" ":" suite "finally" ":" suite
return
TryFinally
(
self
.
com_node
(
nodelist
[
2
]),
self
.
com_node
(
nodelist
[
5
]),
lineno
=
nodelist
[
0
][
2
])
def
com_try_except
(
self
,
nodelist
):
# try_except: 'try' ':' suite (except_clause ':' suite)* ['else' suite]
def
com_try_except_finally
(
self
,
nodelist
):
# ('try' ':' suite
# ((except_clause ':' suite)+ ['else' ':' suite] ['finally' ':' suite]
# | 'finally' ':' suite))
if
nodelist
[
3
][
0
]
==
token
.
NAME
:
# first clause is a finally clause: only try-finally
return
TryFinally
(
self
.
com_node
(
nodelist
[
2
]),
self
.
com_node
(
nodelist
[
5
]),
lineno
=
nodelist
[
0
][
2
])
#tryexcept: [TryNode, [except_clauses], elseNode)]
stmt
=
self
.
com_node
(
nodelist
[
2
])
clauses
=
[]
elseNode
=
None
finallyNode
=
None
for
i
in
range
(
3
,
len
(
nodelist
),
3
):
node
=
nodelist
[
i
]
if
node
[
0
]
==
symbol
.
except_clause
:
...
...
@@ -944,9 +942,16 @@ class Transformer:
clauses
.
append
((
expr1
,
expr2
,
self
.
com_node
(
nodelist
[
i
+
2
])))
if
node
[
0
]
==
token
.
NAME
:
elseNode
=
self
.
com_node
(
nodelist
[
i
+
2
])
return
TryExcept
(
self
.
com_node
(
nodelist
[
2
]),
clauses
,
elseNode
,
lineno
=
nodelist
[
0
][
2
])
if
node
[
1
]
==
'else'
:
elseNode
=
self
.
com_node
(
nodelist
[
i
+
2
])
elif
node
[
1
]
==
'finally'
:
finallyNode
=
self
.
com_node
(
nodelist
[
i
+
2
])
try_except
=
TryExcept
(
self
.
com_node
(
nodelist
[
2
]),
clauses
,
elseNode
,
lineno
=
nodelist
[
0
][
2
])
if
finallyNode
:
return
TryFinally
(
try_except
,
finallyNode
,
lineno
=
nodelist
[
0
][
2
])
else
:
return
try_except
def
com_with
(
self
,
nodelist
):
# with_stmt: 'with' expr [with_var] ':' suite
...
...
Misc/NEWS
Dosyayı görüntüle @
ad29e637
...
...
@@ -4,8 +4,25 @@ Python News
(
editors
:
check
NEWS
.
help
for
information
about
editing
NEWS
using
ReST
.)
What
's New in Python 2.5 beta 2?
================================
*Release date: XX-JUL-2006*
Core and builtins
-----------------
Library
-------
- The compiler module now correctly compiles the new try-except-finally
statement (bug #1509132).
What'
s
New
in
Python
2.5
beta
1
?
================================
=
================================
*
Release
date
:
20
-
JUN
-
2006
*
...
...
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