mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-35717: Fix KeyError exception raised when using enums and compile (GH-11523)
https://bugs.python.org/issue17467
This commit is contained in:
parent
5c8f537669
commit
1fd06f1eca
4 changed files with 13 additions and 1 deletions
|
@ -419,7 +419,7 @@ class EnumMeta(type):
|
|||
if module is None:
|
||||
try:
|
||||
module = sys._getframe(2).f_globals['__name__']
|
||||
except (AttributeError, ValueError) as exc:
|
||||
except (AttributeError, ValueError, KeyError) as exc:
|
||||
pass
|
||||
if module is None:
|
||||
_make_class_unpicklable(enum_class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue