The issue here is that hasattr() behaves differently between python2 and python3.
On python2 it catches all exceptions to return False.
On python3 it only catches AttributeError to return False, all others exceptions (here DetachedInstanceError) are not caught.
The issue here is that hasattr() behaves differently between python2 and python3. eError) are not caught.
On python2 it catches all exceptions to return False.
On python3 it only catches AttributeError to return False, all others exceptions (here DetachedInstanc