Fix SyntaxError in Klondike-v0 - #192
Conversation
The elif checking turn_count >= max_turns was written at the outer if/else level, but the else block above had already been opened, so Python raised SyntaxError at import time. Any use of Klondike-v0 would fail immediately. Moved the elif so it correctly chains to the 'if is_won()' check inside the else block, matching the original intent of 'if won -> elif ran out of turns -> otherwise continue playing'.
|
Ready to merge. This fixes a hard (Note: the repo runs no CI on PRs, so this was verified by inspection against |
|
Verified. LGTM, recommend merge. |
Cloning
mainand trying to import the Klondike env fails at parse time:git clone --depth 1 https://github.com/LeonGuertler/TextArena.git cd TextArena python -m py_compile textarena/envs/Klondike/env.pySo
ta.make("Klondike-v0")has been broken since the env was added in #154.Cause & fix
Line 119's
elifwas indented to the outer if/else level, but the surroundingelse:had already opened — Python can't chainelifonto a closedelse. From context it was meant to chain ontoif self.klondike.is_won():inside theelseblock. Indented theelifand its body one level. No behavior change beyond making the module importable.Verification