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
8b58b84d
Kaydet (Commit)
8b58b84d
authored
Mar 01, 2001
tarafından
Ka-Ping Yee
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add __author__ variable.
Robustify: don't rely on modules being present in sys.modules.
üst
66efbc74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
inspect.py
Lib/inspect.py
+5
-2
No files found.
Lib/inspect.py
Dosyayı görüntüle @
8b58b84d
...
@@ -24,7 +24,8 @@ Here are some of the useful functions provided by this module:
...
@@ -24,7 +24,8 @@ Here are some of the useful functions provided by this module:
# This module is in the public domain. No warranties.
# This module is in the public domain. No warranties.
__version__
=
'Ka-Ping Yee <ping@lfw.org>, 1 Jan 2001'
__author__
=
'Ka-Ping Yee <ping@lfw.org>'
__date__
=
'1 Jan 2001'
import
sys
,
types
,
string
,
dis
,
imp
,
tokenize
import
sys
,
types
,
string
,
dis
,
imp
,
tokenize
...
@@ -196,7 +197,7 @@ modulesbyfile = {}
...
@@ -196,7 +197,7 @@ modulesbyfile = {}
def
getmodule
(
object
):
def
getmodule
(
object
):
"""Try to guess which module an object was defined in."""
"""Try to guess which module an object was defined in."""
if
isclass
(
object
):
if
isclass
(
object
):
return
sys
.
modules
[
object
.
__module__
]
return
sys
.
modules
.
get
(
object
.
__module__
)
try
:
try
:
file
=
getsourcefile
(
object
)
file
=
getsourcefile
(
object
)
except
TypeError
:
except
TypeError
:
...
@@ -630,3 +631,5 @@ def stack(context=1):
...
@@ -630,3 +631,5 @@ def stack(context=1):
def
trace
(
context
=
1
):
def
trace
(
context
=
1
):
"""Return a list of records for the stack below the current exception."""
"""Return a list of records for the stack below the current exception."""
return
getinnerframes
(
sys
.
exc_traceback
,
context
)
return
getinnerframes
(
sys
.
exc_traceback
,
context
)
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