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
96ff0840
Kaydet (Commit)
96ff0840
authored
Ara 15, 2011
tarafından
Meador Inge
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #13593: updating the importlib utility decorators for __qualname__.
üst
c2f98742
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
_bootstrap.py
Lib/importlib/_bootstrap.py
+1
-1
test_util.py
Lib/importlib/test/test_util.py
+10
-0
No files found.
Lib/importlib/_bootstrap.py
Dosyayı görüntüle @
96ff0840
...
...
@@ -111,7 +111,7 @@ def _write_atomic(path, data):
def
_wrap
(
new
,
old
):
"""Simple substitute for functools.wraps."""
for
replace
in
[
'__module__'
,
'__name__'
,
'__doc__'
]:
for
replace
in
[
'__module__'
,
'__name__'
,
'__
qualname__'
,
'__
doc__'
]:
setattr
(
new
,
replace
,
getattr
(
old
,
replace
))
new
.
__dict__
.
update
(
old
.
__dict__
)
...
...
Lib/importlib/test/test_util.py
Dosyayı görüntüle @
96ff0840
...
...
@@ -59,6 +59,11 @@ class ModuleForLoaderTests(unittest.TestCase):
self
.
raise_exception
(
name
)
self
.
assertIs
(
module
,
sys
.
modules
[
name
])
def
test_decorator_attrs
(
self
):
def
fxn
(
self
,
module
):
pass
wrapped
=
util
.
module_for_loader
(
fxn
)
self
.
assertEqual
(
wrapped
.
__name__
,
fxn
.
__name__
)
self
.
assertEqual
(
wrapped
.
__qualname__
,
fxn
.
__qualname__
)
class
SetPackageTests
(
unittest
.
TestCase
):
...
...
@@ -108,6 +113,11 @@ class SetPackageTests(unittest.TestCase):
module
.
__package__
=
value
self
.
verify
(
module
,
value
)
def
test_decorator_attrs
(
self
):
def
fxn
(
module
):
pass
wrapped
=
util
.
set_package
(
fxn
)
self
.
assertEqual
(
wrapped
.
__name__
,
fxn
.
__name__
)
self
.
assertEqual
(
wrapped
.
__qualname__
,
fxn
.
__qualname__
)
def
test_main
():
from
test
import
support
...
...
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