Skip to content

Commit aa16ead

Browse files
check if opt contains json
1 parent 2b53308 commit aa16ead

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

frontend/catalyst/compiler.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,18 @@ def to_ppm_spec(*args, stdin=None, options: Optional[CompileOptions] = None):
389389

390390
raw_json_format = _quantum_opt(*opts, *args, stdin=stdin)
391391
regex_search_for_json = re.search(r"\{[a-zA-Z0-9_\":\{\},\n]+\}", raw_json_format)
392+
393+
# No ppm_specs json is found
394+
if regex_search_for_json is None:
395+
return raw_json_format
396+
392397
json_ppm_specs = regex_search_for_json.group(0)
393398
json_ppm_specs = json_ppm_specs.replace(",\n}", "\n}")
394399
json_ppm_specs = json.loads(json_ppm_specs)
395400
return json_ppm_specs
396401

397402

403+
398404
class Compiler:
399405
"""Compiles MLIR modules to shared objects by executing the Catalyst compiler driver library."""
400406

0 commit comments

Comments
 (0)