Michael Bayer I did too. But I tried to keep the generated value in the exception we are going to raise. That means making a variable referencing the value, and in finally, attach that variable to the exception to be raised. I initially wrote
gist, then I don't want repeat return return_val and wanted the logic to be clearer here, thus the refactoring and creating NeedAsyncRegenerationException.
I admit I over did it a little. If you didn't see it fit, please let me know how to improve it or rework it, I hope to learn a lot from here :D.