diff --git a/.gitea/workflows/python-syntax.yml b/.gitea/workflows/python-syntax.yml index b2fb672..672a72f 100644 --- a/.gitea/workflows/python-syntax.yml +++ b/.gitea/workflows/python-syntax.yml @@ -60,8 +60,11 @@ jobs: monitor_pid=$! # Wait up to 5s for the process to exit (or be killed by the monitor) - timeout 5s wait $pid 2>/dev/null || true - status=$? + if timeout 5s bash -c 'while kill -0 "$1" 2>/dev/null; do sleep 0.1; done' _ "$pid"; then + status=0 + else + status=$? + fi # Stop the monitor and cleanup kill $monitor_pid 2>/dev/null || true @@ -95,8 +98,11 @@ jobs: fi # Default behavior for other files: try --version with a 5s timeout - timeout 5s python "$file" --version - status=$? + if timeout 5s python "$file" --version; then + status=0 + else + status=$? + fi # If it ran successfully, continue if [ $status -eq 0 ]; then