only accept AttributeError as indicating no __prepare__ attribute on a metaclass, allowing lookup errors to propogate
diff --git a/Misc/NEWS b/Misc/NEWS
index ee43e63..a04e068 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@
 Core and Builtins
 -----------------
 
+- Handle errors from looking up __prepare__ correctly.
+
 - Issue #5939: Add additional runtime checking to ensure a valid capsule
   in Modules/_ctypes/callproc.c.