Nikolaus Rath added the comment:

Benjamin: I think that in most cases the intention of a ".. from None" is to 
disable printing of a stack trace for a specific exception when it occurs in 
the try .. except block. (In the example, that would be suppressing the 
stacktrace for the "Second" exception, because it is explicity converted to 
"Third"). I do not think that this ought to effect the printing of exceptions 
that occured previously and higher-up in the call chain.

In other words, I think it is natural to expect that

def foo():
   try:
      do_stuff
   except Something:
      raise SomethingElse from None

disables printing the stack trace for `Something` exceptions when they occur in 
the try..except block -- but not to hide the exception context for exceptions 
that occured before foo() was even called.

----------

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

Reply via email to