Skip to content

Commit 5d0bfa8

Browse files
committed
Stop-gap solution for mypy OOM, by invoking gc for every run laike9m#7
1 parent 4611fc5 commit 5d0bfa8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

views/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import glob
2+
import gc
23
import os
34
from dataclasses import dataclass
45
from pathlib import Path
@@ -114,6 +115,7 @@ def _load_challenges() -> dict[ChallengeName, Challenge]:
114115
@staticmethod
115116
def _type_check_with_mypy(code) -> TypeCheckResult:
116117
raw_result = api.run(["--config-file", str(MYPY_CONFIG), "-c", code])
118+
gc.collect()
117119
return TypeCheckResult(
118120
stdout=raw_result[0], stderr=raw_result[1], passed=raw_result[2] == 0
119121
)

0 commit comments

Comments
 (0)