On Mon, Jan 6, 2014 at 9:56 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: >> Why is a StopIteration bubbling up? (I don't have Flask, so I can't >> verify this.) Is it as simple as "this should be raising from None", >> or is there something else going on? > > Remember that "raise Spam from None" only works from Python 3.3 onwards. > Personally, I think that releasing nested tracebacks before having a way to > suppress the display was a strategic blunder, but it's fixed now, at least > for those who can jump straight to 3.3 and not bother supporting 3.1 and > 3.2.
Fair enough. If it's a problem, I'm sure Flask could do something like (untested): error = False try: next(whatever) except StopIteration: error = True if error: raise ValueError("...") which would work across all. But that's assuming that it really is just a small matter of traceback ugliness. The post implies that it's a lot worse than that. ChrisA -- https://mail.python.org/mailman/listinfo/python-list