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
070f0abc
Kaydet (Commit)
070f0abc
authored
Haz 30, 2010
tarafından
Mark Dickinson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9125: Update parser module for "except ... as ..." syntax.
üst
20379135
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
test_parser.py
Lib/test/test_parser.py
+6
-0
NEWS
Misc/NEWS
+1
-0
parsermodule.c
Modules/parsermodule.c
+7
-4
No files found.
Lib/test/test_parser.py
Dosyayı görüntüle @
070f0abc
...
@@ -235,6 +235,12 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
...
@@ -235,6 +235,12 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
self
.
check_suite
(
"try: pass
\n
except: pass
\n
else: pass
\n
"
self
.
check_suite
(
"try: pass
\n
except: pass
\n
else: pass
\n
"
"finally: pass
\n
"
)
"finally: pass
\n
"
)
def
test_except_clause
(
self
):
self
.
check_suite
(
"try: pass
\n
except: pass
\n
"
)
self
.
check_suite
(
"try: pass
\n
except A: pass
\n
"
)
self
.
check_suite
(
"try: pass
\n
except A, e: pass
\n
"
)
self
.
check_suite
(
"try: pass
\n
except A as e: pass
\n
"
)
def
test_position
(
self
):
def
test_position
(
self
):
# An absolutely minimal test of position information. Better
# An absolutely minimal test of position information. Better
# tests would be a big project.
# tests would be a big project.
...
...
Misc/NEWS
Dosyayı görüntüle @
070f0abc
...
@@ -20,6 +20,7 @@ Library
...
@@ -20,6 +20,7 @@ Library
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
- Issue #9075: In the ssl module, remove the setting of a ``debug`` flag
on an OpenSSL structure.
on an OpenSSL structure.
- Issue #9125: Add recognition of 'except ... as ...' syntax to parser module.
What's New in Python 2.7 release candidate 2?
What's New in Python 2.7 release candidate 2?
=============================================
=============================================
...
...
Modules/parsermodule.c
Dosyayı görüntüle @
070f0abc
...
@@ -2126,10 +2126,13 @@ validate_except_clause(node *tree)
...
@@ -2126,10 +2126,13 @@ validate_except_clause(node *tree)
if
(
res
&&
(
nch
>
1
))
if
(
res
&&
(
nch
>
1
))
res
=
validate_test
(
CHILD
(
tree
,
1
));
res
=
validate_test
(
CHILD
(
tree
,
1
));
if
(
res
&&
(
nch
==
4
))
if
(
res
&&
(
nch
==
4
))
{
res
=
(
validate_comma
(
CHILD
(
tree
,
2
))
if
(
TYPE
(
CHILD
(
tree
,
2
))
==
NAME
)
&&
validate_test
(
CHILD
(
tree
,
3
)));
res
=
validate_name
(
CHILD
(
tree
,
2
),
"as"
);
else
res
=
validate_comma
(
CHILD
(
tree
,
2
));
res
=
res
&&
validate_test
(
CHILD
(
tree
,
3
));
}
return
(
res
);
return
(
res
);
}
}
...
...
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