From 93cd4ea0faa78b4b7cac33c7ed032731a9194dac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filipe=20La=C3=ADns?= Date: Sat, 23 Oct 2021 13:44:23 +0100 Subject: [PATCH 1/2] bpo-45379: add custom error string for FROZEN_DISABLED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Filipe LaĆ­ns --- .../2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst | 2 ++ Python/import.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst b/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst new file mode 100644 index 000000000000000..d8d507900fa9dd6 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst @@ -0,0 +1,2 @@ +Clarify :exc:`ImportError` message when we try to explicitely import a +frozen module but frozen modules are disabled. diff --git a/Python/import.c b/Python/import.c index fe4686cd56b3ba3..15b1956c102df22 100644 --- a/Python/import.c +++ b/Python/import.c @@ -1153,9 +1153,11 @@ set_frozen_error(frozen_status status, PyObject *modname) switch (status) { case FROZEN_BAD_NAME: case FROZEN_NOT_FOUND: - case FROZEN_DISABLED: err = "No such frozen object named %R"; break; + case FROZEN_DISABLED: + err = "Frozen modules are disabled and the frozen object named %R is not essential"; + break; case FROZEN_EXCLUDED: err = "Excluded frozen object named %R"; break; From bb3024b576e27d972ae1167e08c8b2f794976759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Langa?= Date: Thu, 28 Oct 2021 21:47:38 +0200 Subject: [PATCH 2/2] Fix typo Co-authored-by: Gareth Rees --- .../Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst b/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst index d8d507900fa9dd6..f8e2e50dfc3e290 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2021-10-23-13-49-00.bpo-45379.ZF7G3n.rst @@ -1,2 +1,2 @@ -Clarify :exc:`ImportError` message when we try to explicitely import a +Clarify :exc:`ImportError` message when we try to explicitly import a frozen module but frozen modules are disabled.