Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
  • Loading branch information
rathishcholarajan and mtreinish committed Jul 5, 2022
1 parent bca1ba7 commit 2bee5dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qiskit_ibm_runtime/qpy/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"""
+ "$"
)
VERSION_PATTERN_REGEX = re.compile(VERSION_PATTERN, re.VERBOSE | re.IGNORECASE)


@deprecate_arguments({"circuits": "programs"})
Expand Down Expand Up @@ -150,7 +151,7 @@ def dump( # type: ignore[no-untyped-def]
else:
raise TypeError(f"'{program_type}' is not supported data type.")

version_match = re.search(VERSION_PATTERN, __version__, re.VERBOSE | re.IGNORECASE)
version_match = VERSION_PATTERN_REGEX.search(__version__)
version_parts = [int(x) for x in version_match.group("release").split(".")]
header = struct.pack(
formats.FILE_HEADER_PACK, # type: ignore[attr-defined]
Expand Down Expand Up @@ -233,7 +234,7 @@ def load( # type: ignore[no-untyped-def]
)
if data.preface.decode(common.ENCODE) != "QISKIT":
raise QiskitError("Input file is not a valid QPY file")
version_match = re.search(VERSION_PATTERN, __version__, re.VERBOSE | re.IGNORECASE)
version_match = VERSION_PATTERN_REGEX.search(__version__)
version_parts = [int(x) for x in version_match.group("release").split(".")]

header_version_parts = [data.major_version, data.minor_version, data.patch_version]
Expand Down

0 comments on commit 2bee5dd

Please sign in to comment.