[issue12022] AttributeError should report the same details when raised by lookup_special() as when raised in the REPL
Daniel Holth
report at bugs.python.org
Sat May 7 19:19:48 CEST 2011
Daniel Holth <dholth at 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 <report at bugs.python.org>
<http://bugs.python.org/issue12022>
_______________________________________
More information about the Python-bugs-list
mailing list