From cecdd96c7c426f3d1d332bc542b6662afdb2f488 Mon Sep 17 00:00:00 2001 From: "Lev S. Bishop" <18673315+levbishop@users.noreply.github.com> Date: Sun, 25 Jun 2023 12:42:28 -0400 Subject: [PATCH] pylint enable used-before-assignment --- pyproject.toml | 1 - qiskit/circuit/library/standard_gates/x.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f7f8ec4c9286..c24e90cdc702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,7 +105,6 @@ disable = [ "use-list-literal", "use-implicit-booleaness-not-comparison", "use-maxsplit-arg", - "used-before-assignment", ] enable = [ diff --git a/qiskit/circuit/library/standard_gates/x.py b/qiskit/circuit/library/standard_gates/x.py index 659b6ffb4942..bbc5d91815c8 100644 --- a/qiskit/circuit/library/standard_gates/x.py +++ b/qiskit/circuit/library/standard_gates/x.py @@ -575,9 +575,9 @@ def qasm(self): # exporter code (low priority), or we would need to modify 'qelib1.inc' which would be # needlessly disruptive this late in OQ2's lifecycle. The current OQ2 exporter _always_ # outputs the `include 'qelib1.inc' line. ---Jake, 2022-11-21. + old_name = self.name + self.name = "c3sqrtx" try: - old_name = self.name - self.name = "c3sqrtx" return super().qasm() finally: self.name = old_name