File tree Expand file tree Collapse file tree
Lib/test/test_importlib/extension Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,6 +170,13 @@ def load_module_by_name(self, fullname):
170170 loader .exec_module (module )
171171 return module
172172
173+ def test_load_submodule (self ):
174+ '''Test loading a simulated submodule'''
175+ module = self .load_module_by_name ('pkg.' + self .name )
176+ self .assertIsInstance (module , types .ModuleType )
177+ self .assertEqual (module .__name__ , 'pkg.' + self .name )
178+ self .assertEqual (module .str_const , 'something different' )
179+
173180 def test_load_twice (self ):
174181 '''Test that 2 loads result in 2 module objects'''
175182 module1 = self .load_module_by_name (self .name )
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ Release date: 2015-07-05
1010Core and Builtins
1111-----------------
1212
13+ - Issue #24285: Fixed regression that prevented importing extension modules
14+ from inside packages. Patch by Petr Viktorin.
15+
1316Library
1417-------
1518
@@ -24,7 +27,8 @@ Core and Builtins
2427
2528- Issue #24276: Fixed optimization of property descriptor getter.
2629
27- - Issue #24268: PEP 489: Multi-phase extension module initialization
30+ - Issue #24268: PEP 489: Multi-phase extension module initialization.
31+ Patch by Petr Viktorin.
2832
2933- Issue #23955: Add pyvenv.cfg option to suppress registry/environment
3034 lookup for generating sys.path on Windows.
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ get_encoded_name(PyObject *name, const char **hook_prefix) {
4545 if (lastdot < -1 ) {
4646 return NULL ;
4747 } else if (lastdot >= 0 ) {
48- tmp = PyUnicode_Substring (name , lastdot , name_len );
48+ tmp = PyUnicode_Substring (name , lastdot + 1 , name_len );
4949 if (tmp == NULL )
5050 return NULL ;
5151 name = tmp ;
You can’t perform that action at this time.
0 commit comments