mirror of
https://github.com/python/cpython.git
synced 2025-09-22 16:33:26 +00:00
Merge fix for issue #24285 from 3.5
This commit is contained in:
commit
06f155f488
3 changed files with 13 additions and 2 deletions
|
@ -170,6 +170,13 @@ class MultiPhaseExtensionModuleTests(abc.LoaderTests):
|
||||||
loader.exec_module(module)
|
loader.exec_module(module)
|
||||||
return 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):
|
def test_load_twice(self):
|
||||||
'''Test that 2 loads result in 2 module objects'''
|
'''Test that 2 loads result in 2 module objects'''
|
||||||
module1 = self.load_module_by_name(self.name)
|
module1 = self.load_module_by_name(self.name)
|
||||||
|
|
|
@ -22,6 +22,9 @@ Release date: 2015-07-05
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #24285: Fixed regression that prevented importing extension modules
|
||||||
|
from inside packages. Patch by Petr Viktorin.
|
||||||
|
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -36,7 +39,8 @@ Core and Builtins
|
||||||
|
|
||||||
- Issue #24276: Fixed optimization of property descriptor getter.
|
- 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
|
- Issue #23955: Add pyvenv.cfg option to suppress registry/environment
|
||||||
lookup for generating sys.path on Windows.
|
lookup for generating sys.path on Windows.
|
||||||
|
|
|
@ -45,7 +45,7 @@ get_encoded_name(PyObject *name, const char **hook_prefix) {
|
||||||
if (lastdot < -1) {
|
if (lastdot < -1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
} else if (lastdot >= 0) {
|
} else if (lastdot >= 0) {
|
||||||
tmp = PyUnicode_Substring(name, lastdot, name_len);
|
tmp = PyUnicode_Substring(name, lastdot + 1, name_len);
|
||||||
if (tmp == NULL)
|
if (tmp == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
name = tmp;
|
name = tmp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue