Skip to content

Commit 39c8b7c

Browse files
committed
Clean up a few types
Convert lines when `parse=False` from generator to list. The result when `parse=False` is only used in a warning message, and I don't think the generator would even print properly.
1 parent 0083aa1 commit 39c8b7c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pytensor/link/c/cmodule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2120,10 +2120,10 @@ def get_lines(cmd: list[str] | str, parse: bool = True) -> list[str] | None:
21202120
if p.returncode != 0:
21212121
return None
21222122

2123-
lines = BytesIO(stdout + stderr).readlines()
2124-
lines = (l.decode() for l in lines)
2123+
lines_bytes = BytesIO(stdout + stderr).readlines()
2124+
lines = [l.decode() for l in lines_bytes]
21252125
if parse:
2126-
selected_lines = []
2126+
selected_lines: list[str] = []
21272127
for line in lines:
21282128
if (
21292129
"COLLECT_GCC_OPTIONS=" in line

0 commit comments

Comments
 (0)