Skip to content

Commit

Permalink
Fix still more lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed Jul 7, 2023
1 parent 23fe27e commit cc19a4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions qiskit/circuit/library/standard_gates/x.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from math import ceil, pi
import numpy
from qiskit.utils.deprecation import deprecate_func
import qiskit.circuit
from qiskit.circuit.controlledgate import ControlledGate
from qiskit.circuit.gate import Gate
from qiskit.circuit.quantumregister import QuantumRegister
Expand Down Expand Up @@ -589,7 +588,9 @@ def qasm(self):
self.name = "c3sqrtx"
try:
# pylint: disable=cyclic-import
return qiskit.circuit.quantumcircuit._instruction_qasm2(self)
from qiskit.circuit.quantumcircuit import _instruction_qasm2

return _instruction_qasm2(self)
finally:
self.name = old_name

Expand Down
2 changes: 1 addition & 1 deletion test/python/circuit/test_circuit_qasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def test_c3sxgate_roundtrips(self):
self.assertIsInstance(parsed.data[0].operation, C3SXGate)

def test_c3sxgate_qasm_deprecation_warning(self):
"Test deprecation warning for C3SXGate."
"""Test deprecation warning for C3SXGate."""
with self.assertWarnsRegex(DeprecationWarning, r"Correct exporting to OpenQASM 2"):
C3SXGate().qasm()

Expand Down
2 changes: 1 addition & 1 deletion test/python/circuit/test_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def test_label_type_enforcement(self):
instruction.label = 0

def test_deprecation_warnings_qasm_methods(self):
"Test deprecation warnings for qasm methods."
"""Test deprecation warnings for qasm methods."""
with self.subTest("built in gates"):
with self.assertWarnsRegex(DeprecationWarning, r"Correct exporting to OpenQASM 2"):
HGate().qasm()
Expand Down

0 comments on commit cc19a4d

Please sign in to comment.