Skip to content

AI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary

fix: guard os.killpg/getpgid with hasattr for Windows compatibility

jesus alberto corneliob6e79032c226
diff --git a/skills/last30days/scripts/lib/subproc.py b/skills/last30days/scripts/lib/subproc.py
index bc5772e4..74e07d1c 100644
--- a/skills/last30days/scripts/lib/subproc.py
+++ b/skills/last30days/scripts/lib/subproc.py
@@ -81,8 +81,11 @@ def run_with_timeout(
stdout, stderr = proc.communicate(timeout=timeout)
except subprocess.TimeoutExpired:
try:
- os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
- except (ProcessLookupError, PermissionError, OSError):
+ if hasattr(os, "killpg") and hasattr(os, "getpgid"):
+ os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
+ else:
+ proc.kill()
+ except (ProcessLookupError, PermissionError, OSError, AttributeError):
proc.kill()
proc.wait(timeout=5)
raise SubprocTimeout(f"Command {cmd[0]} timed out after {timeout}s")