Skip to content

Commit

Permalink
add ignores for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Apr 30, 2024
1 parent 94d98a2 commit f5740ab
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions vision_agent/agent/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ def time_limit(seconds: float) -> Generator[None, None, None]:
def signal_handler(signum, frame): # type: ignore
raise TimeoutError("Timed out!")

signal.setitimer(signal.ITIMER_REAL, seconds)
signal.signal(signal.SIGALRM, signal_handler)
signal.setitimer(signal.ITIMER_REAL, seconds) # type: ignore
signal.signal(signal.SIGALRM, signal_handler) # type: ignore
try:
yield
finally:
signal.setitimer(signal.ITIMER_REAL, 0)
signal.setitimer(signal.ITIMER_REAL, 0) # type: ignore


def reliability_guard(maximum_memory_bytes: Optional[int] = None) -> None:
Expand All @@ -211,15 +211,15 @@ def reliability_guard(maximum_memory_bytes: Optional[int] = None) -> None:
if maximum_memory_bytes is not None:
import resource

resource.setrlimit(
resource.RLIMIT_AS, (maximum_memory_bytes, maximum_memory_bytes)
resource.setrlimit( # type: ignore
resource.RLIMIT_AS, (maximum_memory_bytes, maximum_memory_bytes) # type: ignore
)
resource.setrlimit(
resource.RLIMIT_DATA, (maximum_memory_bytes, maximum_memory_bytes)
resource.setrlimit( # type: ignore
resource.RLIMIT_DATA, (maximum_memory_bytes, maximum_memory_bytes) # type: ignore
)
if not platform.uname().system == "Darwin":
resource.setrlimit(
resource.RLIMIT_STACK, (maximum_memory_bytes, maximum_memory_bytes)
resource.setrlimit( # type: ignore
resource.RLIMIT_STACK, (maximum_memory_bytes, maximum_memory_bytes) # type: ignore
)

faulthandler.disable()
Expand Down

0 comments on commit f5740ab

Please sign in to comment.