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
ef9a43b2
Kaydet (Commit)
ef9a43b2
authored
Ara 15, 2012
tarafından
Andrew Svetlov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rename test module names for #16421 to don't clash with other tests.
üst
5cb8a31d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
test_imp.py
Lib/test/test_imp.py
+4
-4
_testimportmultiple.c
Modules/_testimportmultiple.c
+6
-6
No files found.
Lib/test/test_imp.py
Dosyayı görüntüle @
ef9a43b2
...
...
@@ -223,11 +223,11 @@ class ImportTests(unittest.TestCase):
fileobj
,
pathname
,
description
=
imp
.
find_module
(
m
)
fileobj
.
close
()
mod0
=
imp
.
load_dynamic
(
m
,
pathname
)
mod1
=
imp
.
load_dynamic
(
'foo'
,
pathname
)
mod2
=
imp
.
load_dynamic
(
'bar'
,
pathname
)
mod1
=
imp
.
load_dynamic
(
'
_testimportmultiple_
foo'
,
pathname
)
mod2
=
imp
.
load_dynamic
(
'
_testimportmultiple_
bar'
,
pathname
)
self
.
assertEqual
(
mod0
.
__name__
,
m
)
self
.
assertEqual
(
mod1
.
__name__
,
'foo'
)
self
.
assertEqual
(
mod2
.
__name__
,
'bar'
)
self
.
assertEqual
(
mod1
.
__name__
,
'
_testimportmultiple_
foo'
)
self
.
assertEqual
(
mod2
.
__name__
,
'
_testimportmultiple_
bar'
)
with
self
.
assertRaises
(
ImportError
):
imp
.
load_dynamic
(
'nonexistent'
,
pathname
)
...
...
Modules/_testimportmultiple.c
Dosyayı görüntüle @
ef9a43b2
...
...
@@ -24,8 +24,8 @@ PyMODINIT_FUNC PyInit__testimportmultiple()
static
struct
PyModuleDef
_foomodule
=
{
PyModuleDef_HEAD_INIT
,
"foo"
,
"foo doc"
,
"
_testimportmultiple_
foo"
,
"
_testimportmultiple_
foo doc"
,
-
1
,
NULL
,
NULL
,
...
...
@@ -34,15 +34,15 @@ static struct PyModuleDef _foomodule = {
NULL
};
PyMODINIT_FUNC
PyInit_foo
()
PyMODINIT_FUNC
PyInit_
_testimportmultiple_
foo
()
{
return
PyModule_Create
(
&
_foomodule
);
}
static
struct
PyModuleDef
_barmodule
=
{
PyModuleDef_HEAD_INIT
,
"bar"
,
"bar doc"
,
"
_testimportmultiple_
bar"
,
"
_testimportmultiple_
bar doc"
,
-
1
,
NULL
,
NULL
,
...
...
@@ -51,7 +51,7 @@ static struct PyModuleDef _barmodule = {
NULL
};
PyMODINIT_FUNC
PyInit_bar
(){
PyMODINIT_FUNC
PyInit_
_testimportmultiple_
bar
(){
return
PyModule_Create
(
&
_barmodule
);
}
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