cpython: 0d52f125dd32 (original) (raw)

--- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -1573,8 +1573,13 @@ def _handle_fromlist(module, fromlist, i fromlist.extend(module.all) for x in fromlist: if not hasattr(module, x):

--- a/Lib/test/test_import.py +++ b/Lib/test/test_import.py @@ -334,6 +334,12 @@ class ImportTests(unittest.TestCase): del sys.path[0] remove_files(TESTFN)

+ class PycRewritingTests(unittest.TestCase): # Test that the co_filename attribute on code objects always points

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,9 @@ Core and Builtins Library ------- +- Issue #15715: importlib.import() will silence an ImportError when the use

--- a/Python/importlib.h +++ b/Python/importlib.h @@ -3843,466 +3843,468 @@ unsigned char _Py_M__importlib[] = { 1,12,1,21,1,10,1,15,1,13,1,13,1,12,1,10, 1,6,1,9,1,21,1,10,1,117,11,0,0,0,95,103, 99,100,95,105,109,112,111,114,116,99,3,0,0,0,0,0,

};