summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorFilipe Laíns <lains@riseup.net>2021-10-28 20:20:07 (GMT)
committerGitHub <noreply@github.com>2021-10-28 20:20:07 (GMT)
commit233841ab782953510ad308dc6173072a6cc6a1cd (patch)
tree0a0f557c21e72c1293747ce2e04a5bce7e45fa5b /Python
parent7401694807fc6b5f7b35ff73c06f4bb852e02946 (diff)
downloadcpython-233841ab782953510ad308dc6173072a6cc6a1cd.zip
cpython-233841ab782953510ad308dc6173072a6cc6a1cd.tar.gz
cpython-233841ab782953510ad308dc6173072a6cc6a1cd.tar.bz2
bpo-45379: add custom error string for FROZEN_DISABLED (GH-29190)
Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Gareth Rees <gdr@garethrees.org>
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index fe4686c..15b1956 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;