We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f7585e2 commit 552fd4fCopy full SHA for 552fd4f
1 file changed
test/qpy_compat/test_qpy.py
@@ -1109,8 +1109,13 @@ def load_qpy(qpy_files, version_parts):
1109
# See https://github.com/Qiskit/qiskit/pull/13814
1110
continue
1111
print(f"Loading qpy file: {path}") # noqa: T201
1112
- with open(path, "rb") as fd:
1113
- qpy_circuits = load(fd)
+ try:
+ with open(path, "rb") as fd:
1114
+ qpy_circuits = load(fd)
1115
+ except Exception as ex:
1116
+ msg = f"****QPY Load error****: Failed to load {path} with the exception: {ex}"
1117
+ sys.stderr.write(msg)
1118
+ sys.exit(1)
1119
equivalent = path in {"open_controlled_gates.qpy", "controlled_gates.qpy"}
1120
for i, circuit in enumerate(circuits):
1121
bind = None
0 commit comments