Protect against passing lookup_class to non-class proxied objects
Protect against passing lookup_class to non-class proxied objects

In some cases the _proxied object points to another Instance, not to the
Class of an Instance node (usually this happens with enum and with our hardcoded inference support
for this library). Instead of getting a TypeError, we check before if the _proxied matches
what we expect.

Found by #2080

PyCQA/astroid