Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dond error in finally block #4843

Open
einsmein opened this issue Nov 30, 2022 · 0 comments
Open

dond error in finally block #4843

einsmein opened this issue Nov 30, 2022 · 0 comments

Comments

@einsmein
Copy link

finally block in dond (here) relies on a parameter from try block.
This results in an UnboundLocalError when the exception happens before datasavers is assigned.

    try:
        with _catch_interrupts() as interrupted, ExitStack() as stack, params_meas_caller as call_params_meas:
            datasavers = [
                stack.enter_context(group.measurement_cxt.run())
                for group in measurements.groups
            ]
        ...
    finally:
        for datasaver in datasavers:
            ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant