Skip to content

Commit

Permalink
Support python3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nkanazawa1989 committed Oct 19, 2022
1 parent 17d2a46 commit 0f02d6a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions qiskit/pulse/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,12 @@
from qiskit.pulse.schedule import Schedule, ScheduleBlock
from qiskit.pulse.transforms.alignments import AlignmentKind

if sys.version_info >= (3, 8):
from functools import singledispatchmethod # pylint: disable=no-name-in-module
else:
from singledispatchmethod import singledispatchmethod


#: contextvars.ContextVar[BuilderContext]: active builder
BUILDER_CONTEXTVAR = contextvars.ContextVar("backend")

Expand Down Expand Up @@ -760,7 +766,7 @@ def append_block(self, context_block: ScheduleBlock):
if len(context_block) > 0:
self._context_stack[-1].append(context_block)

@functools.singledispatchmethod
@singledispatchmethod
def inject_subroutine(
self,
subroutine: Union[Schedule, ScheduleBlock],
Expand Down Expand Up @@ -797,7 +803,7 @@ def _(self, schedule: Schedule):
return
self._context_stack[-1].append(self._naive_typecast_schedule(schedule))

@functools.singledispatchmethod
@singledispatchmethod
def call_subroutine(
self,
subroutine: Union[circuit.QuantumCircuit, Schedule, ScheduleBlock],
Expand Down

0 comments on commit 0f02d6a

Please sign in to comment.