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
6e3358a1
Kaydet (Commit)
6e3358a1
authored
Nis 18, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.2 (#14612)
üst
eca85181
e42fb307
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
test_sys_settrace.py
Lib/test/test_sys_settrace.py
+11
-0
NEWS
Misc/NEWS
+2
-0
frameobject.c
Objects/frameobject.c
+4
-2
No files found.
Lib/test/test_sys_settrace.py
Dosyayı görüntüle @
6e3358a1
...
...
@@ -675,6 +675,14 @@ def no_jump_to_non_integers(output):
no_jump_to_non_integers
.
jump
=
(
2
,
"Spam"
)
no_jump_to_non_integers
.
output
=
[
True
]
def
jump_across_with
(
output
):
with
open
(
support
.
TESTFN
,
"wb"
)
as
fp
:
pass
with
open
(
support
.
TESTFN
,
"wb"
)
as
fp
:
pass
jump_across_with
.
jump
=
(
1
,
3
)
jump_across_with
.
output
=
[]
# This verifies that you can't set f_lineno via _getframe or similar
# trickery.
def
no_jump_without_trace_function
():
...
...
@@ -750,6 +758,9 @@ class JumpTestCase(unittest.TestCase):
# Must set sys.settrace(None) in setUp(), else condition is not
# triggered.
no_jump_without_trace_function
()
def
test_jump_across_with
(
self
):
self
.
addCleanup
(
support
.
unlink
,
support
.
TESTFN
)
self
.
run_test
(
jump_across_with
)
def
test_20_large_function
(
self
):
d
=
{}
...
...
Misc/NEWS
Dosyayı görüntüle @
6e3358a1
...
...
@@ -14,6 +14,8 @@ Core and Builtins
object for importlib.util.module_for_loader and
importlib.machinery.PathFinder.
- Issue #14612: Fix jumping around with blocks by setting f_lineno.
- Issue #14592: Attempting a relative import w/o __package__ or __name__ set in
globals raises a KeyError.
...
...
Objects/frameobject.c
Dosyayı görüntüle @
6e3358a1
...
...
@@ -199,6 +199,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
case
SETUP_LOOP
:
case
SETUP_EXCEPT
:
case
SETUP_FINALLY
:
case
SETUP_WITH
:
blockstack
[
blockstack_top
++
]
=
addr
;
in_finally
[
blockstack_top
-
1
]
=
0
;
break
;
...
...
@@ -206,7 +207,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
case
POP_BLOCK
:
assert
(
blockstack_top
>
0
);
setup_op
=
code
[
blockstack
[
blockstack_top
-
1
]];
if
(
setup_op
==
SETUP_FINALLY
)
{
if
(
setup_op
==
SETUP_FINALLY
||
setup_op
==
SETUP_WITH
)
{
in_finally
[
blockstack_top
-
1
]
=
1
;
}
else
{
...
...
@@ -221,7 +222,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
* be seeing such an END_FINALLY.) */
if
(
blockstack_top
>
0
)
{
setup_op
=
code
[
blockstack
[
blockstack_top
-
1
]];
if
(
setup_op
==
SETUP_FINALLY
)
{
if
(
setup_op
==
SETUP_FINALLY
||
setup_op
==
SETUP_WITH
)
{
blockstack_top
--
;
}
}
...
...
@@ -283,6 +284,7 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
case
SETUP_LOOP
:
case
SETUP_EXCEPT
:
case
SETUP_FINALLY
:
case
SETUP_WITH
:
delta_iblock
++
;
break
;
...
...
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