From bd0c9e44f23ad69d508d606e8f9bd6d4c7af2bf7 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Mon, 7 Nov 2022 12:15:17 +0000 Subject: [PATCH 1/3] gh-91058: Add what's new entry for the improvement in commit 7cfbb49fcd4c85f9bab3797302eadf93df490344 --- Doc/whatsnew/3.12.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 53c72e957d64eb..9181ca0b3c1268 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -106,6 +106,16 @@ Improved Error Messages ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Did you mean to use 'from ... import ...' instead? +* :exc:`ImportError` exceptiond raised from failed ``from import + `` now include suggestions for the value of ```` based on the + available names in ````. Contributed by Pablo Galindo in :gh:`91058`. + + >>> from collections import chainmap + Traceback (most recent call last): + File "", line 1, in + ImportError: cannot import name 'chainmap' from 'collections'. Did you mean: 'ChainMap'? + + New Features ============ From 3c847fceb873f9a0be8c2dcb0eb2326641d42964 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 7 Nov 2022 12:37:10 +0000 Subject: [PATCH 2/3] Update Doc/whatsnew/3.12.rst Co-authored-by: Alex Waygood --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index 9181ca0b3c1268..ea21ccc01b7160 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -106,7 +106,7 @@ Improved Error Messages ^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Did you mean to use 'from ... import ...' instead? -* :exc:`ImportError` exceptiond raised from failed ``from import +* :exc:`ImportError` exceptions raised from failed ``from import `` now include suggestions for the value of ```` based on the available names in ````. Contributed by Pablo Galindo in :gh:`91058`. From 42aca984e11c681ae668fc15b30d882e55fe8255 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Mon, 7 Nov 2022 12:37:15 +0000 Subject: [PATCH 3/3] Update Doc/whatsnew/3.12.rst Co-authored-by: Alex Waygood --- Doc/whatsnew/3.12.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst index ea21ccc01b7160..3802d0e324143e 100644 --- a/Doc/whatsnew/3.12.rst +++ b/Doc/whatsnew/3.12.rst @@ -107,7 +107,7 @@ Improved Error Messages SyntaxError: Did you mean to use 'from ... import ...' instead? * :exc:`ImportError` exceptions raised from failed ``from import - `` now include suggestions for the value of ```` based on the + `` statements now include suggestions for the value of ```` based on the available names in ````. Contributed by Pablo Galindo in :gh:`91058`. >>> from collections import chainmap