From 1fd06f1eca80dcbf3a916133919482a8327f3da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Thu, 24 Jan 2019 20:43:13 +0100 Subject: bpo-35717: Fix KeyError exception raised when using enums and compile (GH-11523) https://bugs.python.org/issue17467 --- Lib/enum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/enum.py') diff --git a/Lib/enum.py b/Lib/enum.py index f7452f0cc0..a958ed8748 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -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) -- cgit v1.2.1