Skip to content

Commit 4b686f8

Browse files
committed
Add a workaround for Windows
1 parent 004aa01 commit 4b686f8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

onlinejudge_verify/languages/python.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import concurrent.futures
33
import functools
44
import pathlib
5+
import platform
56
import sys
67
import textwrap
78
from logging import getLogger
@@ -57,7 +58,11 @@ def _python_list_depending_files(path: pathlib.Path, basedir: pathlib.Path) -> L
5758
try:
5859
executor = concurrent.futures.ThreadPoolExecutor()
5960
future = executor.submit(importlab.graph.ImportGraph.create, env, [str(path)])
60-
res_graph = future.result(timeout=1.0)
61+
if platform.uname().system == 'Windows':
62+
timeout = 5.0 # 1.0 sec causes timeout on CI using Windows
63+
else:
64+
timeout = 1.0
65+
res_graph = future.result(timeout=timeout)
6166
except concurrent.futures.TimeoutError as e:
6267
raise RuntimeError(f"Failed to analyze the dependency graph (timeout): {path}") from e
6368
try:

0 commit comments

Comments
 (0)