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
01debacc
Kaydet (Commit)
01debacc
authored
Ock 02, 2017
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #15812: Merge from 3.5
üst
5430293f
ff0e3b7a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
inspect.py
Lib/inspect.py
+1
-1
test_inspect.py
Lib/test/test_inspect.py
+5
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/inspect.py
Dosyayı görüntüle @
01debacc
...
@@ -1416,7 +1416,7 @@ def getframeinfo(frame, context=1):
...
@@ -1416,7 +1416,7 @@ def getframeinfo(frame, context=1):
except
OSError
:
except
OSError
:
lines
=
index
=
None
lines
=
index
=
None
else
:
else
:
start
=
max
(
start
,
1
)
start
=
max
(
start
,
0
)
start
=
max
(
0
,
min
(
start
,
len
(
lines
)
-
context
))
start
=
max
(
0
,
min
(
start
,
len
(
lines
)
-
context
))
lines
=
lines
[
start
:
start
+
context
]
lines
=
lines
[
start
:
start
+
context
]
index
=
lineno
-
1
-
start
index
=
lineno
-
1
-
start
...
...
Lib/test/test_inspect.py
Dosyayı görüntüle @
01debacc
...
@@ -402,6 +402,11 @@ class TestRetrievingSourceCode(GetSourceBase):
...
@@ -402,6 +402,11 @@ class TestRetrievingSourceCode(GetSourceBase):
# Check filename override
# Check filename override
self
.
assertEqual
(
inspect
.
getmodule
(
None
,
modfile
),
mod
)
self
.
assertEqual
(
inspect
.
getmodule
(
None
,
modfile
),
mod
)
def
test_getframeinfo_get_first_line
(
self
):
frame_info
=
inspect
.
getframeinfo
(
self
.
fodderModule
.
fr
,
50
)
self
.
assertEqual
(
frame_info
.
code_context
[
0
],
"# line 1
\n
"
)
self
.
assertEqual
(
frame_info
.
code_context
[
1
],
"'A module docstring.'
\n
"
)
def
test_getsource
(
self
):
def
test_getsource
(
self
):
self
.
assertSourceEqual
(
git
.
abuse
,
29
,
39
)
self
.
assertSourceEqual
(
git
.
abuse
,
29
,
39
)
self
.
assertSourceEqual
(
mod
.
StupidGit
,
21
,
51
)
self
.
assertSourceEqual
(
mod
.
StupidGit
,
21
,
51
)
...
...
Misc/NEWS
Dosyayı görüntüle @
01debacc
...
@@ -40,6 +40,9 @@ Core and Builtins
...
@@ -40,6 +40,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #15812: inspect.getframeinfo() now correctly shows the first line of
a context. Patch by Sam Breese.
- Issue #29094: Offsets in a ZIP file created with extern file object and modes
- Issue #29094: Offsets in a ZIP file created with extern file object and modes
"w" and "x" now are relative to the start of the file.
"w" and "x" now are relative to the start of the file.
...
...
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