ruff: close file handle (#5180)

* close file handle

* some more open file handles

* must stay open

* remove this close, stays open
This commit is contained in:
Roelof van Dijk
2024-06-27 11:29:47 -07:00
committed by GitHub
parent 83da8b3558
commit 1ff9bbaa61
+1 -1
View File
@@ -316,7 +316,7 @@ def create_schedule_with_vars(outs:List[LazyBuffer], seen:Optional[Set[LazyBuffe
if SAVE_SCHEDULE:
def _save():
print(f"saving {len(SCHEDULES)} schedule graphs to", fp:=getenv("SAVE_SCHEDULE_PATH", "schedule.pkl"))
pickle.dump(SCHEDULES, open(fp, "wb"))
with open(fp, "wb") as f: pickle.dump(SCHEDULES, f)
if len(SCHEDULES) == 0: atexit.register(_save)
SCHEDULES.extend((ps.ast for ps in prescheduled.values()) if getenv("CAPTURE_AST") else [(graph, prescheduled)])
# confirm everything was scheduled correctly