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
6c4fa70d
Kaydet (Commit)
6c4fa70d
authored
Tem 15, 2016
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make too many nested blocks be a SyntaxError instead of a SystemError (closes #27514)
Patch by Ammar Askar.
üst
65e0d8ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
test_syntax.py
Lib/test/test_syntax.py
+4
-2
NEWS
Misc/NEWS
+3
-0
compile.c
Python/compile.c
+1
-1
No files found.
Lib/test/test_syntax.py
Dosyayı görüntüle @
6c4fa70d
...
...
@@ -371,7 +371,9 @@ isn't, there should be a syntax error.
File "<doctest test.test_syntax[42]>", line 3
SyntaxError: 'break' outside loop
This should probably raise a better error than a SystemError (or none at all).
This raises a SyntaxError, it used to raise a SystemError.
Context for this change can be found on issue #27514
In 2.5 there was a missing exception and an assert was triggered in a debug
build. The number of blocks must be greater than CO_MAXBLOCKS. SF #1565514
...
...
@@ -399,7 +401,7 @@ build. The number of blocks must be greater than CO_MAXBLOCKS. SF #1565514
... break
Traceback (most recent call last):
...
Sy
stem
Error: too many statically nested blocks
Sy
ntax
Error: too many statically nested blocks
This tests assignment-context; there was a bug in Python 2.5 where compiling
a complex 'if' (one with 'elif') would fail to notice an invalid suite,
...
...
Misc/NEWS
Dosyayı görüntüle @
6c4fa70d
...
...
@@ -17,6 +17,9 @@ Core and Builtins
unicode paths with embedded null character on Windows instead of silently
truncating them.
- Issue #27514: Make having too many statically nested blocks a SyntaxError
instead of SystemError.
Library
-------
...
...
Python/compile.c
Dosyayı görüntüle @
6c4fa70d
...
...
@@ -3147,7 +3147,7 @@ compiler_push_fblock(struct compiler *c, enum fblocktype t, basicblock *b)
{
struct
fblockinfo
*
f
;
if
(
c
->
u
->
u_nfblocks
>=
CO_MAXBLOCKS
)
{
PyErr_SetString
(
PyExc_Sy
stem
Error
,
PyErr_SetString
(
PyExc_Sy
ntax
Error
,
"too many statically nested blocks"
);
return
0
;
}
...
...
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