summaryrefslogtreecommitdiffstats
path: root/Doc/library/importlib.rst
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2019-01-17 10:41:29 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-01-17 10:41:29 (GMT)
commitcee29b46a19116261b083dc803217aa754c7df40 (patch)
treeb34027910cb04d187121d7371bbdbfd749185087 /Doc/library/importlib.rst
parent8c349565e8a442e17f1a954d1a9996847749d778 (diff)
downloadcpython-cee29b46a19116261b083dc803217aa754c7df40.zip
cpython-cee29b46a19116261b083dc803217aa754c7df40.tar.gz
cpython-cee29b46a19116261b083dc803217aa754c7df40.tar.bz2
bpo-35486: Note Py3.6 import system API requirement change (GH-11540)
While the introduction of ModuleNotFoundError was fully backwards compatible on the import API consumer side, folks providing alternative implementations of `__import__` need to make an update to be forward compatible with clients that start relying on the new subclass. https://bugs.python.org/issue35486
Diffstat (limited to 'Doc/library/importlib.rst')
-rw-r--r--Doc/library/importlib.rst3
1 files changed, 2 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index 3c9a99a..23831c7 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -1737,7 +1737,8 @@ Python 3.6 and newer for other parts of the code).
if spec is not None:
break
else:
- raise ImportError(f'No module named {absolute_name!r}')
+ msg = f'No module named {absolute_name!r}'
+ raise ModuleNotFoundError(msg, name=absolute_name)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
sys.modules[absolute_name] = module