Daniel Holth <dho...@fastmail.fm> added the comment:

Python should explain AttributeError in the same way when it's raised by the 
interpreter. The with: statement below should raise the second AttributeError, 
not the first.

import transaction
with transaction: pass
>>> AttributeError: __exit__

import sys
sys.__exit__
>>> AttributeError: 'module' object has no attribute '__exit__'

----------
title: improve special method lookup error message -> AttributeError should 
report the same details when raised by lookup_special() as when raised in the 
REPL

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12022>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to