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
72e48bd0
Kaydet (Commit)
72e48bd0
authored
Eyl 08, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add test cases to make sure we get the right SyntaxError message for
various illegal uses of "continue".
üst
fd1f1be9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
test_exceptions
Lib/test/output/test_exceptions
+10
-0
test_exceptions.py
Lib/test/test_exceptions.py
+49
-0
No files found.
Lib/test/output/test_exceptions
Dosyayı görüntüle @
72e48bd0
...
...
@@ -27,6 +27,16 @@ RuntimeError
(not used any more?)
spam
SyntaxError
'continue' not supported inside 'try' clause
ok
'continue' not supported inside 'try' clause
ok
'continue' not supported inside 'try' clause
ok
'continue' not properly in loop
ok
'continue' not properly in loop
ok
spam
IndentationError
spam
...
...
Lib/test/test_exceptions.py
Dosyayı görüntüle @
72e48bd0
...
...
@@ -86,6 +86,55 @@ r(SyntaxError)
try
:
exec
'/
\n
'
except
SyntaxError
:
pass
# make sure the right exception message is raised for each of these
# code fragments:
def
ckmsg
(
src
,
msg
):
try
:
compile
(
src
,
'<fragment>'
,
'exec'
)
except
SyntaxError
,
e
:
print
e
.
msg
if
e
.
msg
==
msg
:
print
"ok"
else
:
print
"expected:"
,
msg
else
:
print
"failed to get expected SyntaxError"
s
=
'''
\
while 1:
try:
continue
except:
pass
'''
ckmsg
(
s
,
"'continue' not supported inside 'try' clause"
)
s
=
'''
\
while 1:
try:
continue
finally:
pass
'''
ckmsg
(
s
,
"'continue' not supported inside 'try' clause"
)
s
=
'''
\
while 1:
try:
if 1:
continue
finally:
pass
'''
ckmsg
(
s
,
"'continue' not supported inside 'try' clause"
)
s
=
'''
\
try:
continue
except:
pass
'''
ckmsg
(
s
,
"'continue' not properly in loop"
)
ckmsg
(
"continue
\n
"
,
"'continue' not properly in loop"
)
r
(
IndentationError
)
r
(
TabError
)
...
...
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