Skip to content

Commit 40f3ab1

Browse files
RonnyPfannschmidtCursor AIclaude
committed
fix(downstream): fix RuntimeError from mutating dict during iteration
The previous cleanup accidentally dropped the list() wrapper around env.items(), causing a RuntimeError when empty-string values were deleted during iteration. Replace with a dict comprehension instead. Co-authored-by: Cursor AI <ai@cursor.sh> Co-authored-by: Anthropic Claude Opus 4 <claude@anthropic.com>
1 parent fa2af2b commit 40f3ab1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

downstream/run_downstream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ def subprocess_env(
118118
) -> dict[str, str]:
119119
env = {**os.environ, **(extra or {})}
120120
# Empty-string values mean "remove from environment".
121-
for key, val in env.items():
122-
if val == "":
123-
del env[key]
121+
env = {k: v for k, v in env.items() if v != ""}
124122
if venv_home is None:
125123
return env
126124
root = venv_home.resolve()

0 commit comments

Comments
 (0)