On Thu, Nov 1, 2012 at 2:42 AM, Alessandro Molina
<[email protected]> wrote:
>
> def transactions_retry_wrapper(app_config, controller):
> def wrapped_controller(*args, **kw):
> for attempt in transaction.attempts(3):
> return controller(*args, **kw)
> return wrapped_controller
>
> base_config.register_hook('controller_wrapper', transactions_retry_wrapper)
>
Forgot a with statement here :D
Should have been:
def transactions_retry_wrapper(app_config, controller):
def wrapped_controller(*args, **kw):
for attempt in transaction.attempts(3):
with attempt:
return controller(*args, **kw)
return wrapped_controller
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.