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>
This commit is contained in:
Filipe Laíns 2021-10-28 21:20:07 +01:00 committed by GitHub
parent 7401694807
commit 233841ab78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -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;