Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

bug fix "referenced before assignment" #769

Closed
wants to merge 9 commits into from

Conversation

aaita92
Copy link

@aaita92 aaita92 commented Jan 11, 2020

Summary

at the line 865 rise the error:

" UnboundLocalError: local variable 'qc' referenced before assignment"

when "state_in" and "quantum_registers" are provided.
This is due to the fact that when the if at line 863 is satisfied and the error at line 865 doesn't arise no "qc" variable is declared, generating the error.

Details and comments

at the line 865 rise the error:

" UnboundLocalError: local variable 'qc' referenced before assignment"

when "state_in" and "quantum_registers" are provided. 
This is due to the fact that when the if at line 863 is satisfied and the error at line 865 doesn't arise no "qc" variable is declared, generating the error.
@claassistantio
Copy link

claassistantio commented Jan 11, 2020

CLA assistant check
All committers have signed the CLA.

@woodsp-ibm
Copy link
Member

Thanks for reporting and providing a fix for the issue. Currently the build is failing the lint check on the updated code. If you click Details for the Travis CI where it has the red X then you will see a list of Jobs. One of which has a red X against it. Clicking that will show the build log. I copied the relevant lines here that given the failure reason for convenience:

qiskit/aqua/operators/weighted_pauli_operator.py:861:1: W293 blank line contains whitespace
qiskit/aqua/operators/weighted_pauli_operator.py:863:9: E303 too many blank lines (2)
qiskit/aqua/operators/weighted_pauli_operator.py:865:95: W291 trailing whitespace
qiskit/aqua/operators/weighted_pauli_operator.py:866:45: W291 trailing whitespace

If you have pylint installed locally you can run make lint locally to run the same check.

@woodsp-ibm
Copy link
Member

Thanks again for taking the time and providing this fix!

@woodsp-ibm woodsp-ibm closed this Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants