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
55871f04
Kaydet (Commit)
55871f04
authored
May 26, 2015
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #24285: fix importing extensions from packages
üst
6f68314b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
test_loader.py
Lib/test/test_importlib/extension/test_loader.py
+7
-0
NEWS
Misc/NEWS
+5
-1
importdl.c
Python/importdl.c
+1
-1
No files found.
Lib/test/test_importlib/extension/test_loader.py
Dosyayı görüntüle @
55871f04
...
...
@@ -170,6 +170,13 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
loader
.
exec_module
(
module
)
return
module
def
test_load_submodule
(
self
):
'''Test loading a simulated submodule'''
module
=
self
.
load_module_by_name
(
'pkg.'
+
self
.
name
)
self
.
assertIsInstance
(
module
,
types
.
ModuleType
)
self
.
assertEqual
(
module
.
__name__
,
'pkg.'
+
self
.
name
)
self
.
assertEqual
(
module
.
str_const
,
'something different'
)
def
test_load_twice
(
self
):
'''Test that 2 loads result in 2 module objects'''
module1
=
self
.
load_module_by_name
(
self
.
name
)
...
...
Misc/NEWS
Dosyayı görüntüle @
55871f04
...
...
@@ -10,6 +10,9 @@ Release date: 2015-07-05
Core and Builtins
-----------------
- Issue #24285: Fixed regression that prevented importing extension modules
from inside packages. Patch by Petr Viktorin.
Library
-------
...
...
@@ -24,7 +27,8 @@ Core and Builtins
-
Issue
#
24276
:
Fixed
optimization
of
property
descriptor
getter
.
-
Issue
#
24268
:
PEP
489
:
Multi
-
phase
extension
module
initialization
-
Issue
#
24268
:
PEP
489
:
Multi
-
phase
extension
module
initialization
.
Patch
by
Petr
Viktorin
.
-
Issue
#
23955
:
Add
pyvenv
.
cfg
option
to
suppress
registry
/
environment
lookup
for
generating
sys
.
path
on
Windows
.
...
...
Python/importdl.c
Dosyayı görüntüle @
55871f04
...
...
@@ -45,7 +45,7 @@ get_encoded_name(PyObject *name, const char **hook_prefix) {
if
(
lastdot
<
-
1
)
{
return
NULL
;
}
else
if
(
lastdot
>=
0
)
{
tmp
=
PyUnicode_Substring
(
name
,
lastdot
,
name_len
);
tmp
=
PyUnicode_Substring
(
name
,
lastdot
+
1
,
name_len
);
if
(
tmp
==
NULL
)
return
NULL
;
name
=
tmp
;
...
...
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