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
7a6a9735
Kaydet (Commit)
7a6a9735
authored
Ara 13, 2014
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pop the loop block even for infinite while loops (closes #23048)
üst
0bf02c8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
test_sys_settrace.py
Lib/test/test_sys_settrace.py
+11
-0
NEWS
Misc/NEWS
+2
-0
compile.c
Python/compile.c
+2
-3
No files found.
Lib/test/test_sys_settrace.py
Dosyayı görüntüle @
7a6a9735
...
@@ -551,6 +551,15 @@ def jump_in_nested_finally(output):
...
@@ -551,6 +551,15 @@ def jump_in_nested_finally(output):
jump_in_nested_finally
.
jump
=
(
4
,
9
)
jump_in_nested_finally
.
jump
=
(
4
,
9
)
jump_in_nested_finally
.
output
=
[
2
,
9
]
jump_in_nested_finally
.
output
=
[
2
,
9
]
def
jump_infinite_while_loop
(
output
):
output
.
append
(
1
)
while
1
:
output
.
append
(
2
)
output
.
append
(
3
)
jump_infinite_while_loop
.
jump
=
(
3
,
4
)
jump_infinite_while_loop
.
output
=
[
1
,
3
]
# The second set of 'jump' tests are for things that are not allowed:
# The second set of 'jump' tests are for things that are not allowed:
def
no_jump_too_far_forwards
(
output
):
def
no_jump_too_far_forwards
(
output
):
...
@@ -723,6 +732,8 @@ class JumpTestCase(unittest.TestCase):
...
@@ -723,6 +732,8 @@ class JumpTestCase(unittest.TestCase):
self
.
run_test
(
jump_to_same_line
)
self
.
run_test
(
jump_to_same_line
)
def
test_07_jump_in_nested_finally
(
self
):
def
test_07_jump_in_nested_finally
(
self
):
self
.
run_test
(
jump_in_nested_finally
)
self
.
run_test
(
jump_in_nested_finally
)
def
test_jump_infinite_while_loop
(
self
):
self
.
run_test
(
jump_infinite_while_loop
)
def
test_08_no_jump_too_far_forwards
(
self
):
def
test_08_no_jump_too_far_forwards
(
self
):
self
.
run_test
(
no_jump_too_far_forwards
)
self
.
run_test
(
no_jump_too_far_forwards
)
def
test_09_no_jump_too_far_backwards
(
self
):
def
test_09_no_jump_too_far_backwards
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
7a6a9735
...
@@ -10,6 +10,8 @@ What's New in Python 2.7.10?
...
@@ -10,6 +10,8 @@ What's New in Python 2.7.10?
Core and Builtins
Core and Builtins
-----------------
-----------------
- Issue #23048: Fix jumping out of an infinite while loop in the pdb.
Library
Library
-------
-------
...
...
Python/compile.c
Dosyayı görüntüle @
7a6a9735
...
@@ -1716,10 +1716,9 @@ compiler_while(struct compiler *c, stmt_ty s)
...
@@ -1716,10 +1716,9 @@ compiler_while(struct compiler *c, stmt_ty s)
if there is no else clause ?
if there is no else clause ?
*/
*/
if
(
constant
==
-
1
)
{
if
(
constant
==
-
1
)
compiler_use_next_block
(
c
,
anchor
);
compiler_use_next_block
(
c
,
anchor
);
ADDOP
(
c
,
POP_BLOCK
);
ADDOP
(
c
,
POP_BLOCK
);
}
compiler_pop_fblock
(
c
,
LOOP
,
loop
);
compiler_pop_fblock
(
c
,
LOOP
,
loop
);
if
(
orelse
!=
NULL
)
/* what if orelse is just pass? */
if
(
orelse
!=
NULL
)
/* what if orelse is just pass? */
VISIT_SEQ
(
c
,
stmt
,
s
->
v
.
While
.
orelse
);
VISIT_SEQ
(
c
,
stmt
,
s
->
v
.
While
.
orelse
);
...
...
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