Skip to content

Commit

Permalink
Fix f-string calls (#7243)
Browse files Browse the repository at this point in the history
* treewide: remove extraneous string breaks

* Fix formatting

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
  • Loading branch information
drewrisinger and jakelishman authored Nov 11, 2021
1 parent 2db1685 commit e02119b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions qiskit/circuit/library/generalized_gates/pauli.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def validate_parameter(self, parameter):
return parameter
else:
raise CircuitError(
"Parameter string {0} should contain only 'I', 'X', 'Y', 'Z' characters"
f"Parameter string {parameter} should contain only 'I', 'X', 'Y', 'Z' characters"
)
else:
raise CircuitError("Parameter {0} should be a string of 'I', 'X', 'Y', 'Z' characters")
raise CircuitError(
f"Parameter {parameter} should be a string of 'I', 'X', 'Y', 'Z' characters"
)
2 changes: 1 addition & 1 deletion qiskit/circuit/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self, size=None, name=None, bits=None):
if bits is not None:
# pylint: disable=isinstance-second-argument-not-valid-type
if any(not isinstance(bit, self.bit_type) for bit in bits):
raise CircuitError("Provided bits did not all match register type. bits=%s" % bits)
raise CircuitError(f"Provided bits did not all match register type. bits={bits}")
self._bits = list(bits)
self._bit_indices = {bit: idx for idx, bit in enumerate(self._bits)}
else:
Expand Down

0 comments on commit e02119b

Please sign in to comment.