Skip to content

Commit b0bf2d2

Browse files
committed
Fix windows runtime warning problem
1 parent 7b2f321 commit b0bf2d2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mqt/predictor/ml/predictor.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import logging
1414
import sys
15+
import warnings
1516
import zipfile
1617
from importlib import resources
1718
from pathlib import Path
@@ -191,7 +192,13 @@ def _compile_all_circuits_devicewise(
191192
if (path_compiled_circuits / (target_filename + ".qasm")).exists():
192193
continue
193194
try:
194-
res = timeout_watcher(rl_compile, [qc, device, self.figure_of_merit, rl_pred], timeout)
195+
if sys.platform == "win32":
196+
warnings.warn(
197+
"Timeout is not supported on Windows. Running without timeout.", RuntimeWarning, stacklevel=2
198+
)
199+
res = rl_compile(qc, device, self.figure_of_merit, rl_pred)
200+
else:
201+
res = timeout_watcher(rl_compile, [qc, device, self.figure_of_merit, rl_pred], timeout)
195202
if isinstance(res, tuple):
196203
compiled_qc = res[0]
197204
with Path(path_compiled_circuits / (target_filename + ".qasm")).open("w", encoding="utf-8") as f:

0 commit comments

Comments
 (0)